2
JOptionPane.showInputDialog (...) 메서드 (및 JJOptionPane의 다른 메서드)로 이상한 동작이 있습니다. 생성 된 대화 상자가 절대로 죽지 않는 것처럼 보입니다. 대화 상자가 사라진 후 Window.getWindows()를 호출하면 창의 수가 증가했습니다!대화 상자 서버 다이
시험이 프로그램과 당신은 내가 무슨 뜻인지 확인할 수 :
이public static void main(String[] args) {
final JFrame frame = new JFrame();
final JPanel panel = new JPanel();
final JButton button = new JButton("Show Dialog");
panel.add(button);
frame.add(panel);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
JOptionPane.showInputDialog(frame, "Enter some text : ");
System.out.println(Window.getWindows().length);
}
});
frame.setSize(400, 400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
사람이 무슨 일이 일어나고 있는지 설명 할 수 있습니까?
'왜,
JVM memory
에서 사라 없으며,GC'ed
않을 '당신이 답안에'실제로 코드가 아니'라고'물건'을 역행합니까? 우리는 ** ** itolds **를 가지고 있습니다. – wchargin@WChargin 잘못된 습관 ???, 다른 포럼에서 소리를 지르기 때문에, – mKorbel