Displaying multiple images in a grid

Alright, I'm fairly new to java, so go easy on me if this is a stupid question. . . but I'm a bit stumped.

let's say I have a two-dimensional array representing a grid, where some of the coordinates contain an image.

How can I display the grid in the middle of a pane(or anywhere on a pane for that matter) and keep the correct dimensions - i.e:

if a letter indicates an image and a 0 indicates none, and the grid is

A00

0B0

CD0

how could I make a panel look like such:

|A00

|0B0

|CD0

|

|

[571 byte] By [kaensa] at [2007-11-26 13:51:02]
# 1

Are you using the Graphics class to draw the images on the pane, or is this a swing related question?

If you're using Graphics you can draw your image wherever you want.

If you want to use a LayoutManager to add them as Labels to a panel read about using Layout Managers here:

http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

Rodney_McKaya at 2007-7-8 1:28:07 > top of Java-index,Security,Cryptography...
# 2
Yeah. I'm using the Graphics class. I actually just figured it out as well, thanks for asking though.
kaensa at 2007-7-8 1:28:07 > top of Java-index,Security,Cryptography...