Results 1 to 8 of 8
  1. #1
    BraydenJames is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default JPanel over more JPanels..?

    So for the app I'm developing it contains MANY different panels all within one JFrame. Now I need the functionality of clicking on a maximize button on one of the panels within the frame and bringing it full screen (i.e. filling the frame).

    Ive been having issues covering the other panels with the maximized panel. Is this even possible? Removing all the panels, making this one full-screen, then adding all the other panels back in when I minimize down to normal again is going to be very difficult if that's what I must do.

    Any opinions here? Is there some z-dimension layering that I can't find? Or something? I've tried setting the visibility of the under panels, but they still seem to take up their space.
    Last edited by BraydenJames; 08-19-2010 at 12:56 AM. Reason: Spelling errors >.<

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    I think I'd display the double clicked JPanel in a full screen modal dialog.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    Is your problem something like, even you maximized the JFrame but the panel contents don't resize accordingly and stays as before?
    Adding button that do the functionality of the maximize, then what's the use of maximize button at top-right of Frame.
    -
    If you have multiple panels, use layout manager.
    You can use property like anchor points and horizontal/vertical resize.

    -regards

  4. #4
    BraydenJames is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default

    So I've been trying the dialog thing, and I can put the clicked panel in a full screen dialog pretty easily.. But getting it back in place when they close the dialog is showing to be a bit more difficult.

    And my JFrame containing the panels is fullscreen, then contains about 6 panels within it. I just need to be able to make an individual panel full screen on click, then back to the size it was.

  5. #5
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    Quote Originally Posted by BraydenJames View Post
    I just need to be able to make an individual panel full screen on click, then back to the size it was.
    repaint(); and revalidate();should work.

    Regards

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    A Component can have only one parent. Once you have added your panel to a dialog, it no longer resides in the frame. You'll have to add it back in the appropriate location.

    IMO a better option would be to maintain two copies of each panel.

    db
    Last edited by DarrylBurke; 08-20-2010 at 09:18 PM.

  7. #7
    BraydenJames is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default

    Quote Originally Posted by Darryl.Burke View Post
    A Component can have only one parent. Once you have added your panel to a dialog, it no longer resides in the frame. You'll have to add it back in the appropriate location.

    IMO a better option would be to maintain two copies of each panel.

    db
    Alright well I'm giving this a shot. But quick question, I'm having issues making a copy of a component (JPanel) on the go. Making a new container and setting it equal to the old one just passes around the pointer, and is using the same component, not making a copy. Is there an easy way to do this?

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

Similar Threads

  1. Problems regarding JPanels in JPanels
    By ColtonPhillips in forum AWT / Swing
    Replies: 2
    Last Post: 07-19-2010, 09:33 PM
  2. JList and JPanels
    By JetsYanks in forum New To Java
    Replies: 8
    Last Post: 12-25-2009, 03:11 PM
  3. Posistioning Jpanels
    By owain1221 in forum Java Applets
    Replies: 7
    Last Post: 11-16-2009, 12:21 AM
  4. HELP with jPanels
    By maverik_vz in forum AWT / Swing
    Replies: 1
    Last Post: 03-12-2009, 12:46 PM
  5. How to add Images to JPanels?
    By Soda in forum New To Java
    Replies: 3
    Last Post: 12-08-2007, 06:54 PM

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
  •