I want to use 2 panel in the same frame. But button is not working? How do i do that? I want to put couple of buttons in one panel and other panel will do some other stuff.
public class TestingPage extends JFrame {
JFrame frame=new JFrame();
JPanel panel01;
JPanel panel02;
JButton bttn1;
/**
* @param args
*/
public TestingPage(){
super("Test");
setBounds(700,700,650,500);
setVisible(true);
setLayout(new BorderLayout());
Container cont=frame.getContentPane();
panel01=new JPanel();
panel02=new JPanel();
cont.add(panel01,BorderLayout.EAST);
cont.add(panel02,BorderLayout.WEST);
//setLayout(new BorderLayout());
bttn1=new JButton("Button");
bttn1.setBounds(77, 75, 100,26);
add(bttn1);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Runnable guiCreator= new Runnable(){
@Override
public void run (){
TestingPage page=new TestingPage();
}
};
javax.swing.SwingUtilities.invokeLater(guiCreator);
}
}