Guest User

Applet.Java

a guest
Apr 30th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.63 KB | None | 0 0
  1. import java.awt.Dimension;
  2. import java.awt.Toolkit;
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5.  
  6. import javax.swing.*;
  7.  
  8. /**
  9.  *
  10.  * @author Skyro
  11.  * RSApplet.java
  12.  *
  13.  */
  14. // TODO: Center the Application on Screen.
  15. // TODO: Load the RuneScape Client.
  16. // TODO: Add Functions to the JMenuButtons.
  17.  
  18. public class RSApplet extends JFrame implements ActionListener {
  19.  
  20.     private JMenuItem item1 = new JMenuItem("New Client");
  21.     private JMenuItem item2 = new JMenuItem("Exit");
  22.     private JMenuItem item3 = new JMenuItem("Runetrack");
  23.     private JMenuItem item4 = new JMenuItem("Runeclan");
  24.     private JMenuItem item5 = new JMenuItem("Maxcape");
  25.  
  26.     private double VERSION = 0.1;
  27.  
  28.     private static final long serialVersionUID = 1L;
  29.  
  30.     public RSApplet() {
  31.         JFrame f = new JFrame("RuneScape Client - Version: " + VERSION);
  32.         JMenu menu = new JMenu("File");
  33.         JMenu menu1 = new JMenu("Exp Sites");
  34.         JMenu menu2 = new JMenu("About");
  35.         JMenuBar bar = new JMenuBar();
  36.  
  37.         menu.add(item1);
  38.         menu.add(item2);
  39.  
  40.         menu1.add(item3);
  41.         menu1.add(item4);
  42.         menu1.add(item5);
  43.  
  44.         bar.add(menu);
  45.         bar.add(menu1);
  46.         bar.add(menu2);
  47.  
  48.         f.setJMenuBar(bar);
  49.         f.setSize(768, 560);
  50.         f.setDefaultCloseOperation(EXIT_ON_CLOSE);
  51.  
  52.         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  53.         int height = screenSize.height;
  54.         int width = screenSize.width;
  55.         f.setSize(width / 2, height / 2);
  56.  
  57.         f.setLocationRelativeTo(null);
  58.         f.setVisible(true);
  59.         f.pack();
  60.  
  61.     }
  62.  
  63.     public static void main(String[] args) {
  64.  
  65.         new RSApplet();
  66.  
  67.     }
  68.  
  69.     @Override
  70.     public void actionPerformed(ActionEvent e) {
  71.  
  72.     }
  73.  
  74. }
Advertisement
Add Comment
Please, Sign In to add comment