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 7 of 7

Thread: JInternalFrame not being Displayed

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

    Default JInternalFrame not being Displayed

    I have a "MainFrame" which extends a JFrame and in there I have a variety of diferent components. Some of which is a Menu Bar with three Menu Items. I have an ActionEvent on clicking the 'Config' menu item.

    When I click the Config menu item, I run the following code:

       private void menuConfigActionPerformed(java.awt.event.ActionEvent evt) {                                           
            ConfigFrame configPopUp = new ConfigFrame();
            configPopUp.setVisible(true);          
        }

    The ConfigFrame extends JInternalFrame.

    All I want to do is show this ConfigFrame once I click the Config menu item. For some reason, the ConfigFrame doesn't ever show?

    Please can someone help me where to look?

    Thanks


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: JInternalFrame not being Displayed

    Where is the ConfigFrame object added to a container for it to be shown?
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    CarlRostron (September 10th, 2014)

  4. #3
    Junior Member
    Join Date
    Sep 2014
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: JInternalFrame not being Displayed

    I haven't manually added any code to add the ConfigFrame object to a Container. I thought that I just had to create a New Instance of the ConfigFrame object and call the .SetVisible method to see it. Are you saying I have to add the ConfigFrame object to another container say a JFrame?

  5. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: JInternalFrame not being Displayed

    Add print statements to ensure the action is being executed and then post the ConfigFrame code if you still cannot get it to display. If written correctly, it should be able to be shown on its own. BTW - a JDialog is more commonly used as a child interface to a JFrame because of its ability to set modality.

  6. The Following User Says Thank You to GregBrannon For This Useful Post:

    CarlRostron (September 10th, 2014)

  7. #5
    Junior Member
    Join Date
    Sep 2014
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: JInternalFrame not being Displayed

    Ok thanks. I have just tried the same thing with a JFrame instead of JInternalFrame and it worked. I will look into the JDialog you have mentioned though.

    Thanks to you both.

  8. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: JInternalFrame not being Displayed

    Look at the API doc for the JInternalFrame class. It's explained there.
    If you don't understand my answer, don't ignore it, ask a question.

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

    Default Re: JInternalFrame not being Displayed

    Maybe what you want is a JDialog instead.
    Edit: Whoops, didnt see the other post.

Similar Threads

  1. No images being displayed
    By Leonardo1143 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 5th, 2013, 02:57 PM
  2. Can't seem to get this image to be displayed!
    By mkrage in forum What's Wrong With My Code?
    Replies: 0
    Last Post: October 27th, 2012, 06:07 PM
  3. no image is being displayed.. please help..
    By namita in forum AWT / Java Swing
    Replies: 2
    Last Post: July 23rd, 2012, 11:52 AM
  4. Replies: 1
    Last Post: September 26th, 2011, 07:23 AM
  5. Certain Chinese Characters not displayed properly.
    By kerwintang in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: August 20th, 2009, 08:23 AM