Step by Step Instructions for Creating Your First Java Application in NetBeans 8.x

 

  1. Choose File /  New Project. Under Categories, select Java.  Under Projects, select Java Class Library. Click Next.
  2. Under Project Name, enter the name of your application.  Change the Project Location to any folder on your computer.
  3. Click Finish. The IDE creates the project folder.
  4. Right-click the project node in the Projects window or  Files window and select New > Other. Under Categories, select Swing GUI Forms. Under File Types, select JFrame Form. Click Next.
  5. Under Class Name, enter the name of your application. Leave Package blank for now (default package).
  6. Click Finish. The IDE creates the JFrame form in the specified package. The Form opens in the Design editor.
  7. IMPORTANT: Right click your JFrame's background panel (not on any component or embedded panel), or right click your JFrame in the Navigator panel, and choose "Set Layout..." on the pop-up menu, then select "Null Layout".
  8. Add several components (click component, click on design panel; OR right-click on design panel and choose Add From Palette).
  9. Repeat step 7 as necessary (see below for instructions for specific components).
  10. To Run - Right click on Projects.../<formname>.java  select Run File (or SHIFT-F6)  (or click the green Run button).

What to turn in

Component-specific Instructions

 

to add icon images to buttons or labels, and have the image automatically bundled in your application's JAR file.

  1. Create an "images" package under your project's Source Packages in the Project pane (if you haven't already).
  2. Select the Icon... property of the component.
  3. The Icon property editor is displayed. xxx
  4. Click Import to Project... and select the image you want to use off your system's hard disk. Click Next.
  5. In the Select target folder page of the wizard, select your images package folder and click Finish.

 

to populate a JComboBox

 

to add a Menu

1.      First add a MenuBar to the JFrame.

2.      Right click on the JMenuBar object in the Inspector, and select Add Menu (to add another menu.

3.   To add items to a menu, expland the JMenuBar object in the Inpector, right click on the JMenu, choose Add From Palette > Menu Item

 

to add a nested JPanel

1.      Add the Panel to Display.

2. Right click on the Panel and set the Layout to Null Layout.

3.      Add contained components.