Results 1 to 3 of 3
  1. #1
    HariPrasad is offline Member
    Join Date
    Jul 2009
    Posts
    4
    Rep Power
    0

    Exclamation Problem-----JFrame

    I am disabling a JPanel in a JFrame and trying to get another JPanel into the very same JFrame. I succeded in disabling the JPanel but unable to get the another JPanel into that JFrame. Plz help regarding this.

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

    Default

    You will likely need to show code and give greater detail in your problem's description for others to be able to help you. I'm wondering if instead you would benefit by using a CardLayout, but again given the information that's available to us, this is just a guess.

    When posting code, please be sure to highlight the code after pasting it, and then pressing the code tag so that the code will retain its formatting and be readable. Best of luck.

  3. #3
    josemoncas's Avatar
    josemoncas is offline Member
    Join Date
    Jul 2009
    Location
    Madrid (Spain)
    Posts
    11
    Rep Power
    0

    Default

    CardLayout is an excellent solution for switching panels in the same JFrame.

    As the moderator has said, you should try to give more details on your problem and post some code for the rest to understand the problem better.

    Just guessing, I think your current problem is that the JFrame doesn't revalidate its contents and that's way your new added JPanel doesn't show up. Try calling revalidate() in the JFrame.

    Hope it helps.
    The web that offers Java utilities (classes) which make programming Swing applications an easier task: JMC Java utilities

Similar Threads

  1. JFrame resizing problem
    By Bluefox815 in forum AWT / Swing
    Replies: 7
    Last Post: 02-24-2011, 08:56 PM
  2. Help! problem with program (using JFrame)
    By linux1man in forum New To Java
    Replies: 5
    Last Post: 01-21-2009, 09:46 PM
  3. Simple JFrame Problem
    By DC1 in forum New To Java
    Replies: 4
    Last Post: 06-06-2008, 08:09 AM
  4. JFrame problem
    By vassil_zorev in forum AWT / Swing
    Replies: 1
    Last Post: 01-25-2008, 03:53 AM
  5. JFrame problem
    By saytri in forum New To Java
    Replies: 6
    Last Post: 01-11-2008, 06:12 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
  •