i can some one help me with jframe and panel. i want to create button using jpanel. i look online but they seem to have different ways to do it and i have no idea which is the best way to do this. ex some people extends jframe at top. other create jframe j = new jframe in main etc...
This is what iam trying to do. dont worry about my logic here. this is just so i can understand how to extends etc....
**
main.java will call aaaa.java.
aaaa.java will call bbbb.java
bbbb.java will create one button and that button will have a actionlistener.
**
public class Main extends JFrame{
public Main() {
// TODO Auto-generated constructor stub
}
public static void main(String[] args){
aaaa a = new aaaa(); //??
}
}
public class aaaa extends JFrame{ //???
public aaaa() {
bbbb b = new bbbb(); //??
}
}
public class bbbb implements ActionListener{ //????
JButton b1 = new JButton("check here");
public bbbb() {
//??
}
public void actionPerformed(ActionEvent e) {
}
}