Got a Frame in Java:
Frame AFrame = new Frame("Frame with components");
The frame's top right "x" close button is not working by default. How can I set that ?
Got a Frame in Java:
Frame AFrame = new Frame("Frame with components");
The frame's top right "x" close button is not working by default. How can I set that ?
You should use a JFrame and then
JFrame AFrame = new JFrame("Frame with components");
AFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
But if you insist on Frame then add a listener:
AFrame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});