Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 1.08 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. //////////////THE GUI////////////////
  2.  
  3. package TabMaker;
  4. import java.awt.event.ActionEvent;
  5. import java.awt.event.ActionListener;
  6.  
  7. import javax.swing.JButton;
  8. import javax.swing.JComboBox;
  9. import javax.swing.JFrame;
  10.  
  11. public class UI extends JFrame{
  12.                 String[] tabs = {"varrock","house","camelot"};
  13.                 JComboBox tab = new JComboBox(tabs);
  14.                 JButton Start = new JButton("Start");
  15.                 public UI(){
  16.                         setLayout(null);
  17.                         tab.setBounds(20, 30, 100, 30);
  18.                         Start.setBounds(15, 5, 40, 20);//this be the gui
  19.                         setSize(200, 100);
  20.                         add(tab);
  21.                         add(Start);
  22.                         StartH();
  23.                        
  24.                 }
  25.                 private void StartH(){
  26.                         Start.addActionListener(new ActionListener(){
  27.  
  28.                                 @Override
  29.                                 public void actionPerformed(ActionEvent arg0) {
  30.                                         dispose();
  31.                                        
  32.                                 }
  33.                                
  34.                         });//one sec let me add this
  35.                 }
  36.         }
  37.  
  38.  
  39.  
  40. ///////////////////////Where it is Opened///////////////////////////
  41.  
  42.         @Override
  43.         public boolean onStart()
  44.         {
  45.                 try{
  46.                 UI x = new UI();
  47.                 x.setVisible(true);//here is where i open it
  48.                 }catch(Exception e){
  49.                         Log.log("failed to open GUI, hope you have varrock tabs :)");
  50.                 }