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

📄 frame1.java

📁 对synthdemo的改进程序,要在JDK环境下运行
💻 JAVA
字号:


import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.synth.SynthLookAndFeel;

import com.sun.java.swing.plaf.motif.MotifLookAndFeel;

import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.Rectangle;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Frame1 extends JFrame {
    
JButton jButton1 = new JButton();
    public static void main(String[] args) throws Exception
        {

                Runnable runner = new Runnable()
                {
                  public void run()
                  {
                        try
                        {

                                SynthLookAndFeel synth = new SynthLookAndFeel();
                                synth.load(Frame1.class.getResourceAsStream("demo.xml"), Frame1.class);
                                UIManager.setLookAndFeel(synth);
                        }
                        catch (Exception ex)
                        {
                                ex.printStackTrace();
                        }
                  }
                };
                SwingUtilities.invokeAndWait(runner);

                Frame1 f = new Frame1();
                f.setVisible(true);
        }

	public Frame1() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
	this.setSize(341, 275);
		this.setTitle("Login");
        getContentPane().setLayout(null);
        jButton1.setBounds(new Rectangle(89, 127, 100, 45));
        jButton1.setText("jButton1");
        this.getContentPane().add(jButton1);
    }

    
}

⌨️ 快捷键说明

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