File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Head First Android this week in the Android 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
It's not a secret anymore!