I want to add an icon to a button but I got a problem, the following code doesn't work and I don't know why:
JToggleButton button = new JToggleButton( new ImageIcon( "images/oval.gif" ) );
My button is showing up, it does what I told it to do but the image is not showing up! The relative directory is existing and if I put some text in the initialisation, like this ( "some text", new ImageIcon //... ) it is showing up but the icon is still not there.
What am I doing wrong?
JToggleButton button = new JToggleButton( new ImageIcon( "images/oval.gif" ) );
My button is showing up, it does what I told it to do but the image is not showing up! The relative directory is existing and if I put some text in the initialisation, like this ( "some text", new ImageIcon //... ) it is showing up but the icon is still not there.
What am I doing wrong?