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

Thread: JFrame appearance

  1. #1
    Member
    Join Date
    May 2013
    Posts
    165
    Thanks
    58
    Thanked 1 Time in 1 Post

    Default JFrame appearance

    Whenever I create a GUI and then run it I always get a JFrame which is grey appear, the correct format is only displayed once I make the JFrame smaller or bigger even if only slightly. Is there something wrong or is this the default display of GUIs?


  2. #2
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    609
    My Mood
    Sleepy
    Thanks
    10
    Thanked 93 Times in 86 Posts

    Default Re: JFrame appearance

    No, it's not the default. Set all components before displaying the JFrame and work on the EDT. It' s hard to help without seeing an SSCCE.

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

    keepStriving (December 11th, 2013)

  4. #3
    Member
    Join Date
    May 2013
    Posts
    165
    Thanks
    58
    Thanked 1 Time in 1 Post

    Default Re: JFrame appearance

    Needed to setVisible(true) after components to JFrame have been added not before.
    This helped swing - Java items appear only after the window is resize - Stack Overflow

Similar Threads

  1. Counting element(s) appearance(s) in arrays
    By alan55 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: August 20th, 2012, 01:03 AM
  2. Gradual appearance of Rectangle...
    By rdheepan in forum Web Frameworks
    Replies: 5
    Last Post: January 13th, 2012, 12:07 AM