Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ayden Smith   on Jun 15 In Java Category.

  
Question Answered By: Lewis Welch   on Jun 15

For a swing container without maximize and minimize  buttons extend a
JDialog, try something like this:

class TestDialog extends javax.swing.JDialog
{

TestDialog()
{
setDefaultCloseOperation(javax.swing.JDialog.DO_NOTHING_ON_CLOSE);
addWindowListener( new java.awt.event.WindowAdapter()
{
public void windowClosing(java.awt.event.WindowEvent e)
{
System.exit(0);
}
} );
setResizable(false);
setBounds(0,0,100,100);
setVisible(true);
}

public static void main(String[] args)
{
TestDialog thisDialog = new TestDialog();
}

}

Share: