These instructions assume the project window is in the upper left, and the properties window is in the lower right of the screen. You might find them minimized with icons along left/right screen edges.
- (Menu) File, New Project....
- (Dialog) Take the default General and Java Application. Click Next.
- (Dialog) Specify where you want it, and what to call the project directory. Unselect Create Main Class because you'll use the GUI class as the main class. Set as Main Project should be checked. Click Finish. This creates a project with the default package, but we'll create a project in the next step.
- (Project pane, right click the project) Select New, JFrame Form...
- (Dialog) Fill in the Class Name and Package fields. You can leave your program in the package, but it is highly recommended to create a named package. you can create multilevel packages by simply typing the the packages names separated by dots, eg.
com.fredswartz.flograf. Click Finish. - You now have a working program with a functioning main program and (empty) window. Try running it. The code that NetBeans generated contains a main method, so it runs and does nothing. You'll have to confirm that this is the "main class" (where the main method you want to use is located) the first time you run it.
No comments:
Post a Comment