📄 demotitleicon.java
字号:
/*
* DemoTitleIcon.java
*
* Created on 2007年10月3日, 上午10:13
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package org.Adam;
import java.awt.*;
import javax.swing.*;
/**
*
* @author acer
*/
public class DemoTitleIcon extends JFrame{
Image iconImage;
String imageName="myIco.gif";
/** Creates a new instance of DemoTitleIcon */
public DemoTitleIcon() {
iconImage=Toolkit.getDefaultToolkit().getImage(imageName);
this.setIconImage(iconImage);
//this.setBounds(300,200,250,200);
this.setSize(500,200);
this.setTitle("设置窗口的图标");
this.setVisible(true);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new DemoTitleIcon();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -