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 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 Murach's Java Servlets and JSP this week in the Servlets 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
I agree. Here's the link:
subject: Panel grid
Similar Threads
Grid overwrites contents of Frame
Plot update error - JMathPlot
Is their a GUI app that can slice, dice ,and resassemble a JPG image on the screen?
Problem in reloading graphics object.
hs teacher needs help - display swing components with coordinates