jb.java

来自「java相关的j2me,j2se的一些相关资料」· Java 代码 · 共 38 行

JAVA
38
字号
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class JB {
    

    public static void main(String args[]){
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (UnsupportedLookAndFeelException ex) {
            ex.printStackTrace();
        } catch (InstantiationException ex) {
            ex.printStackTrace();
        } catch (IllegalAccessException ex) {
            ex.printStackTrace();
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        }
        JFrame frame = new JFrame("yyyyyyyyyyyyyyyyyyyyy");
        frame.setLayout(null);
        frame.setBounds(0,0,500,500);
        frame.setVisible(true);
        frame.setExtendedState(JFrame.ICONIFIED);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        JButton d = new JButton("我的测试");
        d.setBounds(10,10,120,20);
        d.setOpaque(false);
        d.setContentAreaFilled(false);
        d.setVisible(true);
        
        frame.add(d);
    }
    
}

⌨️ 快捷键说明

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