?? imageicondemo.java
字號:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class ImageIconDemo {
public static void main(String[] args) {
JFrame f=new JFrame();
Container content=f.getContentPane();
// Icon icon=new ImageIcon(".//start1.gif");
//getClass().getResource("start1.gif")
Icon icon=new ImageIcon(getClass().getResource("start1.gif"));
JLabel label=new JLabel(icon,JLabel.CENTER);
content.add(label);
f.setSize(300,200);
f.setVisible(true);
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -