EDIT
ImageIcon images [] = {
new ImageIcon("Pictures/Img.0.0.JPG"),
new ImageIcon("Pictures/Img.0.1.JPG"),
new ImageIcon("Pictures/Img.0.2.JPG"),
new ImageIcon("Pictures/Img.0.3.JPG"),
new ImageIcon("Pictures/Img.0.4.JPG"),
.
.
new ImageIcon("Pictures/Img.4.4.JPG")};
for (int r = 0; r<5; r++){
for (int c=0; c<5; c++){
JButton pic = new JButton(images[0]);
pic.addActionListener (this);
one[r][c] = pic;
t.add(pic);}
with this code only one image displays on every button.
This post has been edited by mbarc44: 01 December 2008 - 09:55 AM

New Topic/Question
Reply




MultiQuote






|