⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simplelayers.java

📁 java swing 开发代码
💻 JAVA
字号:
// SimpleLayers.java// A demonstration of the JLayeredPane class.//package	jswing.ch08;import javax.swing.*;import java.awt.Color;public class SimpleLayers extends JFrame {  public SimpleLayers() {    super("LayeredPane Demonstration");    setSize(200, 150);    setDefaultCloseOperation(EXIT_ON_CLOSE);    JLayeredPane lp = getLayeredPane();    // Create 3 buttons    JButton top = new JButton();    top.setBackground(Color.white);    top.setBounds(20, 20, 50, 50);    JButton middle = new JButton();    middle.setBackground(Color.gray);    middle.setBounds(40, 40, 50, 50);    JButton bottom = new JButton();    bottom.setBackground(Color.black);    bottom.setBounds(60, 60, 50, 50);    // Place the buttons in different layers    lp.add(middle, new Integer(2));    lp.add(top, new Integer(3));    lp.add(bottom, new Integer(1));  }  public static void main(String[] args) {    SimpleLayers sl = new SimpleLayers();    sl.setVisible(true);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -