How to change JFrame icon [duplicate]
问题 This question already has an answer here: How to set Icon to JFrame 11 answers I have a JFrame that displays a Java icon on the title bar (left corner). I want to change that icon to my custom icon. How should I do it? 回答1: 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. 回答2: Here is an Alternative that worked