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

    Default Secondary JFrame

    Hi All,

    I am new to java swing and awt. Any help is appreciated a lot.

    I am trying to create a swing application/frame which while starting up should show a secondary frame/dialog and collect some information from the user. This information collected from the secondary frame should be used to start drawing in the GLCanvas in the primary JFrame.

    How do I do this?

    I tried the following: (but got stuck)

    I have two classes-one for the primary frame and another for secondary both derived from JFrame.
    In the primary classes constructor, I create the secondary frame and make it visible and on top. Thus while starting the application it shows the primary frame and the secondary frame.

    But I just want the program to wait there to close the secondary frame so as to continue with the primary frame..

    Is this possible???

    regards
    Jith

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default

    I just want the program to wait there to close the secondary frame
    To have the first class with the frame wait on the second class, use a modal dialog for the second "frame". Create your GUI in a JPanel and add it to the dialog instead of to a JFrame.

  3. #3
    crikey is offline Senior Member
    Join Date
    Jul 2010
    Posts
    125
    Rep Power
    0

    Default

    If you making this from scratch:
    after extending the class to a JFrame, create a new JFrame inside the init():
    Java Code:
    public void initcomponents(){
    JFrame frame = new JFrame();
    }

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

    Default

    Rubbish, the OP needs a JDialog. There is no need to extend a JFrame from his requirements as Norm already posted. What is the init() method? Which class implements that?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    crikey is offline Senior Member
    Join Date
    Jul 2010
    Posts
    125
    Rep Power
    0

    Default

    I was referring to the component loader, which can be whatever you desire

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

    Default

    Oooh, good you didn't refer to the left spinning drambuse, which can also be whatever you desire, because I don't know that one either.

    Seriously, it's nice that you want to help, but if you want to help, stick to the API and try to find out what the OP's questions deal with, instead of having shots in the dark.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,433
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by PhHein View Post
    Oooh, good you didn't refer to the left spinning drambuse, which can also be whatever you desire, because I don't know that one either.
    That makes sense because there are no left spinning drambuses ... well, just a couple of them here and there in the wild but they come with their dynarators and you have to buy the belts too.

    kind regards,

    Jos ;-)

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

Similar Threads

  1. Replies: 5
    Last Post: 06-14-2010, 06:10 PM
  2. Trigger main thread method from secondary thread?
    By DigitalMan in forum Threads and Synchronization
    Replies: 8
    Last Post: 01-26-2010, 02:13 AM
  3. Java not recognizing UNIX secondary group
    By PaulBinni in forum Networking
    Replies: 1
    Last Post: 11-18-2009, 03:45 PM
  4. Replies: 4
    Last Post: 04-22-2009, 11:02 PM
  5. changing the secondary ID of a view
    By schuetzejanett in forum SWT / JFace
    Replies: 0
    Last Post: 08-08-2007, 07:28 PM

Posting Permissions

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