|
-
Feb 9th, 2003, 11:05 PM
#1
Thread Starter
Addicted Member
simple drawing
i have an array of 100 buttons, with icons (that show properly, without a prob), layout using GridLayout
i have a second method that is supposed to change the button's icon. to a differnet icon, (which is in the corrent path and everything is fine, but it doesn't change. when i do
Code:
public void flipTilesToBlank() {
for (int x = 0; x < 100; x++) {
aButton[x].setIcon(new ImageIcon ("blank.jpg"));
aButton[x].paint(aButton[x].getGraphics());
System.out.println(aButton[x].getGraphics());
this.update(aButton[x].getGraphics());
}
}
for the System.out.println(aButton[x].getGraphics()); i get 'null'
what method would i use to redraw after i've set the new image icon, (i'm a bit new to java swing, so not exactly sure, i'm trying the update or i'm trying
aButton[x].paint(aButton[x].getGraphics());
nothing works?? WHY 
thanx for your help
--770
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|