You don't say what the problem is, exactly, but you are mixing old-style AWT classes (eg Panel) with Swing classes (eg JButton). This is always dodgy. You should replace all the AWT ? classes with the swing J? equivalent.
Your buttons should resize to fit the image when you pack the window, although you will probably have to override the default insets to avoid blank space around the icon.
What do you know about Java 1.7.1 that we don't? 1.7 isn't out yet. (Current is 1.6u20).
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
The original Java AWT design was prett limited, so Swing was introduced with a far better architecture (and loads of other small improvements while they were at it).
So what's ReadyTo Program? I thought you were just using those words as simple English, sorry.
The SetMargin method overrides the insets, but I find it's hard to get the button default graqphics out of the way, so I always use JLabels to display graphics, you just have to listen for MouseClicked instead of ActionPerformed.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
implements ActionListener, MouseListener, anyOtherInterfaces
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073