Results 1 to 5 of 5

Thread: JFrame issue

  1. #1
    CapedCrusader is offline Member
    Join Date
    May 2010
    Posts
    1
    Rep Power
    0

    Default JFrame issue

    Hello everyone, I'm having a problem with my JFrame extension. I'm making an extension of a JFrame and everything works nicely, except that none of the components inside will show until I've manually re sized the window. I don't know what to do about it. I would include code but I don't really have any idea where the root of the problem is and I've got quite a bit of code. Has anyone had or heard of such a problem? I searched the forums and the web but haven't come across anything similar. Please help! Thanks.

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

    Default

    Not really an Applet problem.

    How are you positioning and sizing the components in the JFrame?
    Have you tried adjusting their sizes or the size of the JFrame?

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

    Default

    Quote Originally Posted by Norm View Post
    Not really an Applet problem.
    Yep, agree. Moving to the Swing forum.

  4. #4
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

    Default

    This sounds like you're calling setVisible on your GUI before you've added the components. If so, you'll want to first add your components, then call pack() on the JFrame, and then call setVisible(true). If this doesn't help you, you'll probably need to post some code.

    Buena suerte!

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    > I don't really have any idea where the root of the problem is and I've got quite a bit of code
    That's where you've gone wrong. Write just a little code, just enough to compile and run and display a GUI, then run and test it. When you have that working, add some more, but again, a little at a time.

    That way, if your program suddenly becomes erratic, you'll know the problem is with the last bit of code you added, and you'll be able to sort it out easily.

    Note that this is the way most professional programmers work too. Nobody writes a monstrosity with hundreds of lines of code without some testing along the way.

    db

Similar Threads

  1. JFrame from a JFrame in project
    By anah in forum AWT / Swing
    Replies: 2
    Last Post: 04-19-2010, 06:20 PM
  2. Replies: 6
    Last Post: 04-12-2010, 11:33 AM
  3. Passing data from one JFrame to another JFrame
    By tarami in forum New To Java
    Replies: 3
    Last Post: 08-06-2009, 05:44 PM
  4. Replies: 4
    Last Post: 04-22-2009, 11:02 PM
  5. PDF Box issue
    By jazz2k8 in forum Advanced Java
    Replies: 0
    Last Post: 03-20-2009, 11:04 AM

Tags for this Thread

Posting Permissions

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