Hi I did get a solution to put the background image in the buttons, but there's a little problem. I'm not sure as to how I should scale the image exactly to fit within the button ;
eg. SCALED_TO_FIT. Here's the code I've used to put the image & Text within the button.
String str = new String("Images/" + myClass.getIcon());
final ImageIcon imageIcon = new ImageIcon(getURL(str));
JButton button1 = new JButton()
{
Image image = imageIcon.getImage();
{
setOpaque(false);
}
}
public void paintComponent (Graphics g)
{
g.drawImage(image, 0, 0, this);
super.paintComponent(g);
}
};
I'd really appreciate it if somebody can suggest a solution to this problem .
Thanks in advance
Meghna