This is an automated email from the ASF dual-hosted git repository. mbien pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans-website.git
The following commit(s) were added to refs/heads/master by this push: new 13edae0c9 Review of Java tutorial gui-functionality.adoc. I made the following mods: 1. In step 2 of "Creating a Project" I noted that "Java with Ant" project type should be selected. This is the project type that offers the library-sharing functionality mentioned in step 4 of this section. 2. Under "Renamingh the Components" I inserted a step explaining that, in order to make the project gui look like the one in the tutorial image, the horizontal alignment on the labels should [...] new b9a4291d3 Merge pull request #682 from stroudcuster/intro-to-gui 13edae0c9 is described below commit 13edae0c95f49141757b31a2cbcdf30e7e26922d Author: stroud <custerstr...@gmail.com> AuthorDate: Sun Sep 10 12:51:49 2023 -0400 Review of Java tutorial gui-functionality.adoc. I made the following mods: 1. In step 2 of "Creating a Project" I noted that "Java with Ant" project type should be selected. This is the project type that offers the library-sharing functionality mentioned in step 4 of this section. 2. Under "Renamingh the Components" I inserted a step explaining that, in order to make the project gui look like the one in the tutorial image, the horizontal alignment on the labels should be set to RIGHT. 3. Under "Running the Program", I corrected the link to javase-deploy tutorial, as the existing link resulted in a file not found.# Please enter the commit message for your changes. Lines starting --- .../src/content/kb/docs/java/gui-functionality.adoc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/netbeans.apache.org/src/content/kb/docs/java/gui-functionality.adoc b/netbeans.apache.org/src/content/kb/docs/java/gui-functionality.adoc index 89e046af5..176379809 100644 --- a/netbeans.apache.org/src/content/kb/docs/java/gui-functionality.adoc +++ b/netbeans.apache.org/src/content/kb/docs/java/gui-functionality.adoc @@ -43,7 +43,7 @@ For a more comprehensive guide to the GUI Builder's design features, including v The first step is to create an IDE project for the application that we are going to develop. We will name our project ``NumberAddition`` . 1. Choose ``File`` > ``New Project`` . Alternatively, you can click the New Project icon in the IDE toolbar. -2. In the Categories pane, select the Java node. In the Projects pane, choose Java Application. Click Next. +2. In the Categories pane, select Java with Ant. In the Projects pane, choose Java Application. Click Next. 3. Type `NumberAddition` in the Project Name field and specify a path, for example, in your home directory, as the project location. 4. (Optional) Select the Use Dedicated Folder for Storing Libraries checkbox and specify the location for the libraries folder. See link:http://www.oracle.com/pls/topic/lookup?ctx=nb8000&id=NBDAG455[+Sharing a Library with Other Users+] in _Developing Applications with NetBeans IDE_ for more information. 5. Deselect the Create Main Class checkbox if it is selected. @@ -89,10 +89,11 @@ In this step we are going to rename the display text of the components that were 1. Double-click `jLabel1` and change the text property to `First Number:`. 2. Double-click `jLabel2` and change the text to `Second Number:`. 3. Double-click `jLabel3` and change the text to `Result:`. -4. Delete the sample text from `jTextField1`. You can make the display text editable by right-clicking the text field and choosing Edit Text from the popup menu. You may have to resize the `jTextField1` to its original size. Repeat this step for `jTextField2` and `jTextField3`. -5. Rename the display text of `jButton1` to `Clear`. (You can edit a button's text by right-clicking the button and choosing Edit Text. Or you can click the button, pause, and then click again.) -6. Rename the display text of `jButton2` to `Add`. -7. Rename the display text of `jButton3` to `Exit`. +4. If you want the labels right aligned, as the those in the image are, expand the width of the two shorter labels so that they are all the same width. Then open the Properties dialog for each one, and change the Horizontal Alignment property to RIGHT. +5. Delete the sample text from `jTextField1`. You can make the display text editable by right-clicking the text field and choosing Edit Text from the popup menu. You may have to resize the `jTextField1` to its original size. Repeat this step for `jTextField2` and `jTextField3`. +6. Rename the display text of `jButton1` to `Clear`. (You can edit a button's text by right-clicking the button and choosing Edit Text. Or you can click the button, pause, and then click again.) +7. Rename the display text of `jButton2` to `Add`. +8. Rename the display text of `jButton3` to `Exit`. Your Finished GUI should now look like the following screenshot: @@ -207,7 +208,7 @@ NOTE: The location of the ``NumberAddition`` project directory depends on the After a few seconds, the application should start. -NOTE: If double-clicking the JAR file does not launch the application, see xref:../../articles/javase-deploy.adoc#troubleshooting[+this article+] for information on setting JAR file associations in your operating system. +NOTE: If double-clicking the JAR file does not launch the application, see xref:./javase-deploy.adoc#troubleshooting[+this article+] for information on setting JAR file associations in your operating system. You can also launch the application from the command line. @@ -232,7 +233,7 @@ This tutorial has showed how to respond to a simple button event. There are many 1. Go back to the file `NumberAdditionUI.java` in the Editor. Click the Design tab to see the GUI's layout in the GUI Builder. 2. Right-click any GUI component, and select Events from the pop-up menu. For now, just browse the menu to see what's there, you don't need to select anything. -3. Alternatively, you can select Properties from the Window menu. In the Properties window, click the Events tab. In the Events tab, you can view and edit events handlers associated with the currently active GUI component. +3. Alternatively, you can select Properties from the Window/IDE Tools menu. In the Properties window, click the Events tab. In the Events tab, you can view and edit events handlers associated with the currently active GUI component. 4. You can have your application respond to key presses, single, double and triple mouse clicks, mouse motion, window size and focus changes. You can generate event handlers for all of them from the Events menu. The most common event you will use is an Action event. (Learn link:http://java.sun.com/docs/books/tutorial/uiswing/events/generalrules.html#twokinds[+best practices for Event handling+] from Sun's link:http://java.sun.com/docs/books/tutorial/uiswing/events/index.html[+Java Events [...] How does event handling work? Every time you select an event from the Event menu, the IDE automatically creates a so-called event listener for you, and hooks it up to your component. Go through the following steps to see how event handling works. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists