0

my dialog example as following:

public class DialogNotify extends JDialog{
   public DialogNotify() {
      setModal(true);
      setSize(200, 100);
      setVisible(true);
   }
}

how to make it shown frameless ? by frameless, I mean with "close" button on top right or menu bar on top left.

user1447011
  • 1,183
  • 3
  • 11
  • 14

1 Answers1

1

I found this blog entry on the topic: Making a Custom Frameless Window

The key thing is to call JDialog::setUndecorated(true) to suppress the frame and titlebar. You can do the same thing on a JFrame.

The call should be made when the dialog or frame's window is not displayed.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • I have done this to remove the decoration from a JDialog, but all my windows are undecorated now! I'm using Ubuntu 12.04. Anyone have seen this bug? – Rodrigo Jun 10 '14 at 19:56