Java GUI Tutorial for NetBeans

Written by mike wallace
  • Share
  • Tweet
  • Share
  • Email

The NetBeans Integrated Development Environment (IDE) contains a "What you see is what you get" (WYSIWYG) graphical user interface (GUI) editor for Java applications. Use the NetBeans IDE to drag and drop GUI elements onto the editor to visualise the application as you develop it. This decreases development time for GUI applications and increases your control over their appearance. It is quite easy to use and shouldn't take you too long to get started on GUI application development.

Skill level:
Moderately Easy

Other People Are Reading

Things you need

  • Java Software Development Kit with NetBeans Integrated Development Environment (IDE) Bundle (see Resource for link)

Show MoreHide


  1. 1

    Load the NetBeans IDE by clicking on its program icon. When the program loads, navigate to "New/New Project" and select "Java Desktop Application" from the list on the right-hand side of the screen. A new GUI application window appears in the NetBeans visual editor window. To the right of this window, there is a toolbox pane labelled "Palette."

  2. 2

    Click the item labelled "Button" from the "Palette" toolbox pane.

  3. 3

    Move the mouse pointer to the GUI application window. A button will appear under the mouse pointer and track its movements. Click the GUI application window to place the button wherever you like. Once you place the button, the mouse cursor returns to normal.

  4. 4

    Double-click the button to open a "Set Action" dialogue box. This box allows you to set the action that occurs when users click the button.

  5. 5

    Click the drop-down menu labelled "Action" and select "ShowAboutBox." The text on the button changes to "About." When a user clicks on this button, another window will pop up and display some basic information about this application.

  6. 6

    Create another button and open its "Set Action" dialogue by repeating Steps 2 through 4.

  7. 7

    Click the drop-down menu labelled "Action" and select "Exit." This changes the button text to "Exit," and when a user clicks on it, the application will close.

  8. 8

    Run your application by pressing "F6." A window identical to the one located in the NetBeans visual editor appears. Click on the buttons to experiment with the effects each one has. You now have completed a basic GUI application using NetBeans.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.