Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

JFrame Problem

Options
  • 30-08-2006 6:47pm
    #1
    Closed Accounts Posts: 170 ✭✭


    Hi,

    I have a JFrame which contains a couple of JPanels. When I run the application the JFrame appears empty. If I maximise the JFrame and then resize it, the JPanels appear. Why is this happen? and how do I fix it.

    Thanks.:confused:


Comments

  • Registered Users Posts: 4,188 ✭✭✭pH


    What layout manager are you using?


  • Closed Accounts Posts: 170 ✭✭SteamTrean


    pH wrote:
    What layout manager are you using?

    BoxLayout..I was using FLowLayout initially and was getting the same problem.


  • Registered Users Posts: 4,188 ✭✭✭pH


    Possibly could be missing a pack

    - try to compile and get this code running:
    http://www.cs.cf.ac.uk/Dave/HCI/HCI_Handout_CALLER/node55.html

    If that works then just see what's different between it and yours.


  • Closed Accounts Posts: 170 ✭✭SteamTrean


    I had:

    this.setSize(600,700);
    this.setVisible(true);
    //then added all the components


    I cut 'this.setVisible(true);' out and placed it after all the components were added, it's fine now. Haven't touched AWT or Swing in a while, that's my excuse.


Advertisement