자바 스윙쓰고있고 창1번에서 버튼누르면 새창 띄우는거 만들어보려고하는데
버튼추가 이런건 생략하고 창1의 버튼액션
@Override
public void actionPerformed(ActionEvent e) {
Object ob = e.getSource();
if(ob==btnaccept)
{
new prac_2("성공");
}
}
창 2번클래스
public class prac_2 extends Frame implements ActionListener{
Container cp;
public prac_2(String title){
super(title);
this.setBounds(250, 100, 1175, 500);
cp.setBackground(new Color(255, 255, 255));
initDesign();
this.setVisible(true);
}
public void initDesign(){
}
public void start() {
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVisible(false);
dispose();
}
});
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}
}
이렇게하래서 그대로했는데 버튼 눌러도 암것도안나옴ㅠㅠ
창 1에 버튼액션에서 파라미터 e를 받았는데 아무것도 안하신거 같은데
==로 되있는거 equals로 교체해보시면 어떰
감사합니다 열심히해볼게영