主要代码: BufferedImage image = null; try { image = ImageIO.read(this.getClass().getResource("./logo.png")); this.setIconImage(image); } catch(Exception e) { System.out.println(e); }