Create a new ImageIcon
object like this:
ImageIcon img = new ImageIcon(pathToFileOnDisk);
Then set it to your JFrame
with setIconImage()
:
myFrame.setIconImage(img.getImage());
Also checkout setIconImages()
which takes a List
instead.
More Related Contents:
- Sizes of frame icons used in Swing
- How to set Icon to JFrame
- How to add an image to a JFrame title bar?
- how to create own file with icon that inherit from JFrame icon, that I set it, in java and my own file use FileOutputStream and ObjectOutputStream
- Explain the code to create a textfield using java [closed]
- How to programmatically close a JFrame
- Java: Difference between the setPreferredSize() and setSize() methods in components
- Unresponsive KeyListener for JFrame
- How to set output stream to TextArea
- Calling one JFrame from another using Timer without any buttons
- WindowBuilder Design Tab incomplete in Eclipse
- Resizing icon to fit on JButton in Java?
- How to Insert Image into JTable Cell
- Get a Swing component by name
- Java Swing: How can I implement a login screen before showing a JFrame?
- How do I save preference user settings in Java?
- JFrame.dispose() vs System.exit()
- Close one JFrame without closing another?
- How to make a transparent JFrame but keep everything else the same?
- Java Swing adding Action Listener for EXIT_ON_CLOSE
- Java/Swing: Obtain Window/JFrame from inside a JPanel
- how to set JFrame background transparent but JPanel or JLabel Background opaque?
- How do I draw an image to a JPanel or JFrame?
- Change JTree node icons according to the depth level
- How to fit Image size to JFrame Size?
- Java getting download progress
- Java Drag-n-Drop files of specific extension on JFrame
- JFrame: get size without borders?
- Why do we need to extend JFrame in a swing application?
- What is the relation between ContentPane and JPanel?