Hi!
I'm creating a program to manage the March Madness stuff my family does, so I can expand my knowledge of Java.
Right now, I'm encountering a problem with the "New Tournament" dialog box... In the main program's GUI, the user clicks a menu item "New tournament..." and then the "New Tournament" dialog box appears. However, I don't want to allow the user to click out of the "New Tournament" dialog box, or allow them to iconify it.
Right now, I'm using a WindowListener...
//See windowDeactivated and windowIconified private class NewTournamentGUIWindowListener implements WindowListener { public void windowClosing(WindowEvent e) { //This code is not part of the problem MainGUI.newTournamentWindowOpened = false; MainGUI.setStatus(); } public void windowClosed(WindowEvent e) { } public void windowOpened(WindowEvent e) { } public void windowDeactivated(WindowEvent e) { /* * Whenever the user clicks outside the JFrame * it is deiconified and refocused. */ setExtendedState(JFrame.NORMAL); requestFocus(); } public void windowActivated(WindowEvent e) { } public void windowDeiconified(WindowEvent e) { } public void windowIconified(WindowEvent e) { /* * Whenever the user attempts to iconify the window * it immediately deiconifies itself; however, this process * looks sloppy. How can I deactivate the "Minimize" icon * that occurs at the top right of the JFrame? */ setExtendedState(JFrame.NORMAL); } }
Does anyone know how to prevent a window that I've created from being iconified?