Exercise 6: Generating Java Source Code
In this exercise, you will generate the Java code that you will integrate with your program.
- Click the Generate Source Files control
on the Visual Java tool bar.
The Java WorkShop generates three new files in your project directory. A message appears in the lower left corner of the browser when the generation is complete.
- CalculatorRoot.java--Contains the code that creates GUI components
- CalculatorMain.java--Contains the init, start, and stop methods
- Calculator.java--Contains a template for adding event-handling code
The first two files are generated purely by Visual Java and do not need to be edited. The third file, Calculator.java, is the file in which you will add code that makes the calculator perform the correct operation when the user clicks on a button.
Next lesson:
- Exercise 7: Adding Code