![]() |
![]() |
![]() |
![]() |
Light changing methods
We will now create the methods to control the state of the traffic light.
- Choose "Goto method code" from the Code menu in the Canvas Composer.
- Type the following code into the method section:
- Close the Canvas Composer by choosing 'Exit' from the file menu in the Composer. When you are asked if you wish to save your changes, answer "yes". If you are running the tryout version of Simplicity for Java, you may use FinishedTrafficLight.java for the rest of this Tutorial.
- In the Simplicity IDE, click on the 'Java Source Files' Group in the Project Tree to see the file that was just created, TrafficLight.java.
- Control-click TrafficLight.java in the IDE.
- Choose 'Compile' from the pop-up menu which will appear.
- Choose 'Java Class Files' or 'All Files' in the Project Tree to see the new class file that you've created.
Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |
![]() |
![]() |
![]() |
![]() |