Results 1 to 3 of 3
Thread: Expandable Grid Panel
- 08-22-2009, 01:11 PM #1
Expandable Grid Panel
Hi guys,
I'm looking to create a JPanel with a GridLayout, except I want to control-click one of the grid cells in the panel and have it expand to fill the entire panel (then when I do the same again, it should return to the grid view). I can see me having to create a custom layout/control, but I just wondered if anybody has done this type of thing before?
Thanks, Lee.
-
It can be done probably in several ways. One is to put all the grid panels in a JPanel that uses GridLayout, then add this to a main JPanel that uses borderlayout. When a grid panel is clicked swap the gridlayoutpanel for the single panel and call revalidate and repaint. Then if ctrl-clicked again, remove all from the gridlayout panel and then re-add the panels (don't do this and it will have a gap due to the panel that was removed from the grid and shown in the main panel). Then add the gridlayout panel to the main panel, borderlayout.center, and again revalidate and repaint.
Play with it, and you'll likely get it to work out.
- 08-23-2009, 10:53 AM #3
Similar Threads
-
Database Grid
By leoleo4614 in forum AWT / SwingReplies: 1Last Post: 12-13-2008, 07:02 AM -
How do i place objects onto a grid?
By Nakira in forum New To JavaReplies: 7Last Post: 11-14-2008, 06:49 PM -
[SOLVED] How to create a Grid?
By Nakira in forum New To JavaReplies: 11Last Post: 11-12-2008, 10:45 AM -
how to get the grid values
By jazz2k8 in forum Advanced JavaReplies: 2Last Post: 11-06-2008, 02:11 PM -
Help with Grid Layout
By coco in forum AWT / SwingReplies: 1Last Post: 08-06-2007, 08:03 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks