Rabu, 10 November 2010

panggil form lain

btnPanggil.setMnemonic('P');  << 1
     btnPanggil.addActionListener(new ActionListener() {  << 2
       public void actionPerformed(ActionEvent e) {  << 3
        Form_kedua b = new Form_kedua();  << 4
        b.show();  << 5
        }
       
        });
     setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); << 6
     this.getContentPane().setLayout(null); << 7
     this.setTitle("Test Memanggil Form lain"); << 8
     btnPanggil.setBounds(new Rectangle(90,10,250,20)); << 9
     this.getContentPane().add(btnPanggil,null); << 10
     this.setSize(500,200); << 11
     Dimension layar = Toolkit.getDefaultToolkit().getScreenSize(); << 12
     int L = (layar.width - this.getSize().width) / 2; << 13
     int T = (layar.height - this.getSize().height) / 2; << 14
     this.setLocation(L,T); << 15
     this.setResizable(false); << 16
     this.setVisible(true); << 17

Tidak ada komentar:

Posting Komentar