tomschuring1
asked on
JDialog minimizing
Hello,
I was wondering if the top level JDialog can have a minimize button ? I found how to do it for a JInternalFrame but I don't think I can use this as my top level window for the application (is this correct ?)
------ code----------
ABConsole m_console = new ABConsole();
m_console.show();
------ end code------
where :
ABConsole is
------ code----------
public class ABConsole extends JDialog
{
.....
}
------ end code------
what do I need to do to enable the "minimize" button in the title bar?
I was wondering if the top level JDialog can have a minimize button ? I found how to do it for a JInternalFrame but I don't think I can use this as my top level window for the application (is this correct ?)
------ code----------
ABConsole m_console = new ABConsole();
m_console.show();
------ end code------
where :
ABConsole is
------ code----------
public class ABConsole extends JDialog
{
.....
}
------ end code------
what do I need to do to enable the "minimize" button in the title bar?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Kotan, that just kills the whole dialog. I was looking for a minimize button.
ASKER
perhaps it is 'abusing' the JDialog functionality. I decided to go with a Frame instead. thanks
public class ABConsole extends javax.swing.JDialog {
public ABConsole(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
private void initComponents() {
addWindowListener(new java.awt.event.WindowAdapt
public void windowClosing(java.awt.eve
closeDialog(evt);
}
});
pack();
}
/** Closes the dialog */
private void closeDialog(java.awt.event
setVisible(false);
dispose();
System.exit(1);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
new ABConsole(new javax.swing.JFrame(), true).show();
}
}