Results 1 to 5 of 5

Thread: Custom dialog?

  1. #1
    t500yo is offline Member
    Join Date
    Jun 2010
    Posts
    14
    Rep Power
    0

    Default Custom dialog?

    Hello ppl
    I really do not know how to ask my question, so I'm just going to ask it.
    I want to create a dialog window attached to a parent window. There are several ways to create a simple dialog, but I would like to create a more advanced dialog with multiple fields.

    So I have got two questions:
    How can I prevent the user from focusing on the parent
    How do I export the input from my 'dialog' window (lets say two fields, a user name and a password) to a field on the parent JPanel.

    I know you guys know the answer - I'm just another Java newbie.
    Thank you in advance!

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

    Default

    Quote Originally Posted by t500yo View Post
    Hello ppl
    How can I prevent the user from focusing on the parent
    Make your Dialog modal.
    Quote Originally Posted by t500yo View Post
    How do I export the input from my 'dialog' window (lets say two fields, a user name and a password) to a field on the parent JPanel.
    You still have a reference to your dialog object after it's closed, get the values from that object.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    t500yo is offline Member
    Join Date
    Jun 2010
    Posts
    14
    Rep Power
    0

    Default

    Hello phHein
    Thanks for your reply. Unfortunately my dialog is not really a dialog, but a JFrame. Now, according to the API, I cannot use setModal(true) on a JFrame.
    thanks in advance!

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

    Default

    That's why you should use a JDialog. Get the contentPane of your JFrame and set it as the contentPane of a JDialog, just to test the functionality.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    t500yo is offline Member
    Join Date
    Jun 2010
    Posts
    14
    Rep Power
    0

    Default

    oh.
    Seriously.. I AM dumb... I read some stuff wrong in the link I posted before. That is really...

    Thanks phHein!

Similar Threads

  1. Custom JCheckBox with a corresponding Dialog box
    By divgrad.chris in forum AWT / Swing
    Replies: 1
    Last Post: 04-15-2010, 09:59 PM
  2. How to create custom Input Dialog
    By Bab in forum SWT / JFace
    Replies: 2
    Last Post: 08-02-2009, 12:21 PM
  3. Example of SWT Dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-09-2008, 12:01 PM
  4. Dialog Box
    By uncopywritable in forum New To Java
    Replies: 2
    Last Post: 07-30-2007, 12:42 PM

Tags for this Thread

Posting Permissions

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