is poppy.jpg in the same directory as your java file? u should put them in the same folder.
Type: Posts; User: relixus
is poppy.jpg in the same directory as your java file? u should put them in the same folder.
when you compile your project into a jar file the image for your button will be included inside the jar file, and you will have problems referencing to it directly, u have to use...
try this:
Icon icon = new ImageIcon(getClass().getResource("Poppy.jpg"));