Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Opening JDialog from JDialog

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Opening JDialog from JDialog

    Hello to all!

    I am very glad I've found this forum, because I really want to learn to program in Java. For now, I have this problem with the project I'm working on for my University.

    I have main JFrame (let's call it "Main"), from which I've opened one JDialog ("Dialog1"). Now I want to open another JDialog ("Dialog2") from Dialog1, but I keep getting an error.

    First one (Dialog1) I've opened this way:

    Dialog1 d = new Dialog1(Main.this);
    d.setVisible(true);

    The second one (Dialog2), I've tried to open the same way, but the error says that the constructor of Dialog2 is undefined for this code:

    Dialog2 d = new Dialog2(Dialog1.this);
    d.setVisible(true);

    Now, my question is, why can't I open Dialog2 from Dialog1 the same way I've opened Dialog1 from Main?

    P.S. English is not my main language (I'm from Serbia), so I'm sorry if I've made some mistakes.


  2. #2
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: Opening JDialog from JDialog

    What is the error message you get?

  3. #3
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Opening JDialog from JDialog

    "Constructor for Dialog2 is undefined"

  4. #4
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: Opening JDialog from JDialog

    The error message is pretty clear I would say.
    The constructor you are trying to call is not defined.

    What kind of constructor are you trying to call?

  5. #5
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Opening JDialog from JDialog

    It doesn't matter now, I've found the other way. Thank you for your time.

Similar Threads

  1. JDialog
    By hooshdar3 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: July 15th, 2014, 08:14 AM
  2. which is better jdialog or joptionpane?
    By tonu in forum AWT / Java Swing
    Replies: 1
    Last Post: January 6th, 2014, 07:01 AM
  3. Is a modal JDialog possible in this scenario?
    By JAPA1972 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 17th, 2013, 04:01 AM
  4. Need some help with this JFrame, or JDialog.
    By MR bruto in forum What's Wrong With My Code?
    Replies: 7
    Last Post: May 10th, 2013, 08:14 AM
  5. JDialog Failing to Render...
    By snowguy13 in forum AWT / Java Swing
    Replies: 2
    Last Post: April 7th, 2012, 11:55 AM

Tags for this Thread