This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Game Development and the fly likes Panel grid Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Panel grid" Watch "Panel grid" New topic

Panel grid

S. Shree

Joined: Jun 25, 2008
Posts: 16

I am looking to create a panel grid like this :

[] [] [] [] []
[] [] [] [] []
[] [] [] [] []

I have taken an array for that purpose:

I also took a for loop to display them.

But when I run my app the panels did not load as intended, I tried changing the layout manager but didn't work. I am a beginner at java any help would really be nice. By the b is a reference variable for a object of the type JFrame.

Thanks in advance
[ June 25, 2008: Message edited by: rash exponent ]
S. Shree

Joined: Jun 25, 2008
Posts: 16
I found out the solution myself. For those who are having same problem - I used the GridLayout for the panel that holds the array of panels.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

"rash exponent",
Please check your private messages.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
wood burning stoves
subject: Panel grid
It's not a secret anymore!