Results 1 to 7 of 7
  1. #1
    xuanhung123 is offline Member
    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    0

    Default How to show JDialog is a JFrame ?

    Hello everybody ! I'm a newbie.

    I have a problem.I have the child JFrame and the parent JFrame. How to show the child JFrame as a JDialog from the parent JFrame. I can't use setVisible() method because I will still operate in the parent JFrame. Thanks for advance.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    xuanhung123 is offline Member
    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    0

    Default

    But I use Netbeans GDE to my application. I create a new JFrame then I can't re-write code to a JDialog.

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

    Default

    Dear lord :rolleyes:
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    Quote Originally Posted by xuanhung123 View Post
    But I use Netbeans GDE to my application. I create a new JFrame then I can't re-write code to a JDialog.
    Can't write code. Ho....
    It's simple close netbeans, open your file in notepad and edit there just what you want. :cool:

  6. #6
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    Oh yeah,
    you can also do this,
    Java Code:
    public class ChildFrame extends JDialog{
      public ChildFrame(JFrame frame){....
    // -- code here
    }
    
    public static void main(String[] args){
        try{
          ChildFrame frame = new ChildFrame(new JFrame());
         //...................
    }
    }

  7. #7
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    I can't use setVisible() method because I will still operate in the parent JFrame
    Then your JDialog needs to be "non modal". Read the JDialog API for the method to do this.

Similar Threads

  1. passing an object from one JDialog to Jframe
    By sinha in forum AWT / Swing
    Replies: 7
    Last Post: 12-16-2009, 04:56 PM
  2. Communicate JFrame with JDialog
    By BeRniTo in forum AWT / Swing
    Replies: 2
    Last Post: 08-31-2009, 02:07 PM
  3. Unable to display JDialog from JFrame
    By jv5 in forum NetBeans
    Replies: 2
    Last Post: 02-04-2009, 04:33 AM
  4. Returning data from a JFrame/JDialog?!
    By Joe2003 in forum AWT / Swing
    Replies: 6
    Last Post: 01-08-2009, 12:14 AM
  5. problems with jDialog in a JFrame
    By bbq in forum AWT / Swing
    Replies: 1
    Last Post: 07-05-2007, 04:14 AM

Posting Permissions

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