📄 layeredpaneexp.java
字号:
/**
* @(#)LayeredPaneExp.java
*
*
* @author
* @version 1.00 2007/11/12
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Win extends JFrame {
JLayeredPane p;
JLabel lab;
JButton btn;
Win(String s) {
super(s);
p=new JLayeredPane();
lab=new JLabel(new ImageIcon("E:/backgroud.jpg"));
lab.setPreferredSize(p.getSize());
p.add(lab,new Integer(0));
btn=new JButton("Click here!");
btn.setBounds(20,20,50,30);
// p.add(btn,JLayeredPane.DRAG_LAYER);
add(p);
//add(lab);
setSize(500,500);
setVisible(true);
validate();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
public class LayeredPaneExp {
/**
* Creates a new instance of <code>LayeredPaneExp</code>.
*/
public LayeredPaneExp() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
new Win("Example Window");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -