eyda228 0 Report post Posted October 12, 2008 import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.text.*; public class MenuUtama extends JFrame implements ActionListener { private JLabel title, title2, background, time1, time2, logo1, logo2, COPYRIGHT; private JButton click1, click2, developer; private JPanel panelAtas, middlePanel; public MenuUtama() { super(" Address Book Management System "); Container metal = getContentPane(); metal.setBackground(Color.gray); metal.setLayout(null); //Upper PaneL panelAtas = new JPanel(); ImageIcon icon1 = new ImageIcon( "" ); logo1 = new JLabel(icon1); title = new JLabel(" UNIVERSITI UTARA MALAYSIA "); title.setFont(new Font("Verdana",Font.BOLD,10)); title2 = new JLabel(" ADDRESS BOOK MANAGEMENT SYSTEM "); title2.setFont(new Font("Snap ITC",Font.BOLD,15)); background = new JLabel(new ImageIcon("BCG3.JPG")); COPYRIGHT = new JLabel("Orbit Corp. Copyright Version 2008"); Date td = new Date(); String tdate1 = DateFormat.getDateInstance().format(td); JLabel time1 = new JLabel(" " + tdate1 + " "); time1.setFont(new Font("Goudy Stout",Font.BOLD,14)); time1.setForeground(Color.red); JLabel time2 = new JLabel(); new TimerTime(time2); //Middle Panel middlePanel = new JPanel(); click1 = new JButton(" LOGIN "); click1.addActionListener(this); click2 = new JButton(" QUIT "); click2.addActionListener(this); ImageIcon icon2 = new ImageIcon( "Globe.GIF" ); developer = new JButton(icon2); developer.addActionListener(this); ImageIcon icon3 = new ImageIcon( "uum.gif" ); logo2 = new JLabel(icon3); title.setBounds (200,140,600,30); title2.setBounds (60,180,600,30); time1.setBounds (400,20,250,35); time2.setBounds (430,45,100,30); click1.setBounds (240,260,100,30); click2.setBounds (240,300,100,30); logo1.setBounds (140,75,300,35); logo2.setBounds (260,10,50,160); developer.setBounds (540,434,40,45); COPYRIGHT.setBounds (340,450,600,30); background.setBounds (1,1,600,500); metal.add(title); metal.add(title2); metal.add(time1); metal.add(time2); metal.add(click1); metal.add(click2); metal.add(logo1); metal.add(developer); metal.add(logo2); metal.add(COPYRIGHT); metal.add(background); setSize(600,510); setVisible (true); setResizable(false); setLocation(300,100); } public void actionPerformed(ActionEvent e) { if (e.getSource() == click1) { Password menu = new Password(); dispose(); } else if (e.getSource() == click2) { System.exit(0); } else if (e.getSource() == developer) { SystemDeveloper menu = new SystemDeveloper(); dispose(); } } public static void main(String []args) { MenuUtama label = new MenuUtama(); label.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } } class SystemDeveloper extends JFrame implements ActionListener { private JTextArea txtArea1; private JLabel title, background; private JButton button1; public SystemDeveloper() { super(" STUDENT ADDRESS STORE "); Container metal = getContentPane(); metal.setBackground(Color.gray); metal.setLayout(null); title = new JLabel("System Developer"); title.setFont(new Font("GOUDYSTO.TTF",Font.BOLD,20)); txtArea1 = new JTextArea("\nProject Leader\nSuguna\n\nAssistant\nZuraida\nSuhailee"+"\n"); txtArea1.setFont(new Font("Georgia",Font.BOLD,15)); txtArea1.setBackground(Color.gray); background = new JLabel(new ImageIcon("BCG3.JPG")); button1 = new JButton("-=BACK=-"); button1.addActionListener(this); title.setBounds(180,50,300,30); txtArea1.setBounds(150,100,300,300); background.setBounds (1,1,600,500); button1.setBounds(250,410,100,30); metal.add(title); metal.add(txtArea1); metal.add(button1); metal.add(background); setSize(600,510); setVisible (true); setResizable(false); setLocation(300,100); } public void actionPerformed(ActionEvent e) { if(e.getSource() == button1) { MenuUtama menu = new MenuUtama(); dispose(); } } } Quote Share this post Link to post Share on other sites