Custom Modal Dialog Window
Im currently making a game. When the user clicks a menu item i have it open a new window which asks for a username, password, and has two buttons, cancel and connect. How can i have it be a modal window (I want the user to handle the window before focus is shifted back to the main window)?
Re: Custom Modal Dialog Window
U can use the JDialog constructor as shown below :-
JDialog(owner, title, isModal)
Ex:
JDialog dialog = new JDialog(null, "A Modal Dialog", true)
If u specify 'true' for the third argument , the dialog becomes modal.
then call
dialog.show();
from the Menu click event.
All the best!! Happy coding......
Re: Custom Modal Dialog Window