0

For some reason my JFrame doesn't have a close button? I tried changing the code but it didn't seem to work.

public NewJFrame()
{
    this.setUndecorated(true);
    this.setVisible(true);


    initComponents();

    this.setDefaultCloseOperation(NewJFrame.EXIT_ON_CLOSE);
    Toolkit tk = Toolkit.getDefaultToolkit();
    int x = (int) tk.getScreenSize().getWidth();
    int y = (int) tk.getScreenSize().getHeight();
    this.setSize(x,y);
}
TT.
  • 15,774
  • 6
  • 47
  • 88
Louw
  • 63
  • 10

1 Answers1

3

The close button is one of the decorations you removed with

this.setUndecorated(true);

If you want it back you'll have to remove this line or create one of your own.