CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2005
    Posts
    24

    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)?

  2. #2
    Join Date
    Jun 2005
    Posts
    33

    Thumbs up 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......

  3. #3
    Join Date
    Jun 2005
    Posts
    15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured