opening a JDialog


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 12 of 12

Thread: opening a JDialog

  1. #1
    Join Date
    Feb 2005
    Posts
    55

    opening a JDialog

    hey i have a button on a main frame and i want to open a JDialog. The main frame views information which is stored in a file and the JDialog is a form to add new information. Thanks.

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    'this' refers to the frame owner, the string is the title, the boolean value is for modal. if true, the parent frame cannot be accessed until the dialog has been closed.

    JDialog d = new JDialog(this, "title", true);

    d.show();

  3. #3
    Join Date
    Feb 2005
    Posts
    55
    I have worked that out all ready. I have a class called viewer and i want to open a class which implements JDialog and its called InputInfo and i want to open it through a butten in viewer

  4. #4
    Join Date
    Feb 2004
    Posts
    808
    er.. is JDialog an interface? i didnt think so.. given that it's not an interface, how did you "implements" it?
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  5. #5
    Join Date
    Feb 2005
    Posts
    55
    sorry InputInfo extends JDialog and i wont to open it from a button in viewInfo.

  6. #6
    Join Date
    Mar 2004
    Posts
    635
    so are you asking how to show a jdialog, or how to perform an action from a button click?

  7. #7
    Join Date
    Feb 2005
    Posts
    55
    I want to know how to open a JDialog
    JDialog n = new JDialog(); opens a empty dialog i want to open a dialog which i have already created.

  8. #8
    Join Date
    Feb 2004
    Posts
    808
    myJDialog.show()?
    myJDialog.setVisible(true)?
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  9. #9
    Join Date
    Feb 2005
    Posts
    55
    It only opens a plain dialog i want to open a dialog ive already created

  10. #10
    Join Date
    Mar 2004
    Posts
    635
    oh my, this is going to be a long thread.

    call the show() method from YOUR dialog. If it's still blank, then you've created your dialog wrong. Did you remember to add components to it?

  11. #11
    Join Date
    Feb 2005
    Posts
    55
    I have created
    public void show()
    {
    InputInfo info = new InputInfo();
    }
    but it cannot overrite JDialog show if i put throws IOException but it throws IOException if i can put it here where else can i put it?

    This was my problem in viewer as it throws an IOException when i did the same line of code but im overriting a button there.

  12. #12
    Join Date
    Mar 2004
    Posts
    635
    why are you trying to overwrite show()?

    If InputInfo is your dialog class, then you do info.show()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center