This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes gridlayout - set size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "gridlayout - set size" Watch "gridlayout - set size" New topic

gridlayout - set size

Cathy Song
Ranch Hand

Joined: Jul 01, 2003
Posts: 92
Hi all,

I have a panel with girdlayout with images in each cell.
When i mouse over an image, the size increases, and this causes the whole
grid to re-size and act crazy. How can I set an option by which my cells dont resize?

Cathy Song
Ranch Hand

Joined: Jul 01, 2003
Posts: 92
Any clues? I dont want my cells to be resized as components are added.
Cant I fix the size of each cell?
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
GridLayout doesn't pay much attention to the size of the components you hand it. It divides the available space up according to the number of rows or columns you specify and adds the components. I was unable to create the behavior you describe. If this app doesn't help maybe you can modify it to show the behavior.
Cathy Song
Ranch Hand

Joined: Jul 01, 2003
Posts: 92
Thanks much!

I agree. Here's the link:
subject: gridlayout - set size
Similar Threads
settiing size of Jpanel
Separator in JToolBar
how to set the size of of a JPanel according to the Screen Size
how to resize JPanel size to JFrame size
Displaying Image