I have a package com.supercorp.killerapp and within it is a package(com.supercorp.killerapp.views) if I’m not creating the app with the guiformbuilder:
- How do I set the icon of a button on a JInternalFrame that is in the views directory?
- In general, how do I access images in a different folder?
- Should all my images be contained in a seperate folder?
The syntax I’m using is:
JButton iconButton = new JButton(new ImageIcon("page_delete.png"));
The button isn’t displaying the image.
I put in the jar that contains my application, in a package called
com.example.GreatApp.resourcesand then load it using:Update. Full example