SHOW:
|
|
- or go back to the newest paste.
| 1 | import java.awt.*; | |
| 2 | import java.awt.event.*; | |
| 3 | import java.io.*; | |
| 4 | import java.util.*; | |
| 5 | ||
| 6 | //Database of cars | |
| 7 | //Neel Pandya, January 2012, Podar International School | |
| 8 | //Samsung laptop running Windows 8 Developer Preview, Eclipse, the purpose of this program is to simplify the creation of a good database of cars for Autoworld Japan | |
| 9 | ||
| 10 | public class home extends EasyApp | |
| 11 | {
| |
| 12 | public static void main(String[] args) | |
| 13 | { new home(); }
| |
| 14 | Label lCasPage = addLabel("H O M E",250,50,250,50,this);
| |
| 15 | Button bCoordinator = addButton("LOG-IN",100,190,150,50,this);
| |
| 16 | Button bStudent = addButton("SEARCH CARS",350,190,150,50,this);
| |
| 17 | Menu principalMenu = addMenu("Option|Help|Quit");
| |
| 18 | public home() | |
| 19 | {
| |
| 20 | setBackground(new Color(50,160,150)); | |
| 21 | lCasPage.setBackground(new Color(50,160,150)); | |
| 22 | lCasPage.setForeground(new Color(255,255,255)); | |
| 23 | lCasPage.setFont(new Font("Courier New",3,16));
| |
| 24 | setTitle("YO");
| |
| 25 | } | |
| 26 | public void actions(Object source,String command) | |
| 27 | {
| |
| 28 | if(command.equals("Option|Help"))//this command is used to show the HELP form
| |
| 29 | {
| |
| 30 | String helpdata = ""; | |
| 31 | helpdata = "- THE 'LOG-IN' BUTTON ALLOWS ONE TO LOG-IN TO USE ADVANCED FEATURES SUCH AS ADDING, EDITING, AND DELETING CARS FROM THE DATABASE." + "\n" + "" + "\n" | |
| 32 | + "- THE 'SEARCH CARS' BUTTON ALLOWS ONE TO SEARCH FOR CARS ALREADY IN THE DATABASE."; | |
| 33 | new Help(helpdata); | |
| 34 | } | |
| 35 | if(command.equals("Option|Quit"))
| |
| 36 | {
| |
| 37 | System.exit(0); | |
| 38 | } | |
| 39 | if(source == bCoordinator) | |
| 40 | {
| |
| 41 | new Logins(); | |
| 42 | this.dispose(); | |
| 43 | } | |
| 44 | if (source == bStudent) | |
| 45 | {
| |
| 46 | new search(); | |
| 47 | this.dispose(); | |
| 48 | } | |
| 49 | } | |
| 50 | } |