?? lookandfeeldemo.java
字號:
/* * @(#)SwingApplet.java 1.14 01/12/03 * * Copyright 2002 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */import java.awt.*;import java.awt.event.*;import java.net.*;import java.applet.*;import javax.swing.*;/* * A very simple applet. */public class LookAndFeelDemo extends JApplet { JButton button; public void init() { // 更換注釋的內(nèi)容可以改變界面風(fēng)格 //String laf ="com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; //String laf ="com.sun.java.swing.plaf.motif.MotifLookAndFeel"; String laf ="javax.swing.plaf.metal"; try { UIManager.setLookAndFeel(laf); } catch (UnsupportedLookAndFeelException exc) { System.err.println("Warning: UnsupportedLookAndFeel: " + laf); } catch (Exception exc) { System.err.println("Error loading " + laf + ": " + exc); } getContentPane().setLayout(new FlowLayout()); button = new JButton("<html><body>Hello, <br>I'm a Swing Button!<br>"+ "You can see different styles!</body></html>"); getContentPane().add(button); } public void stop() { if (button != null) { getContentPane().remove(button); button = null; } }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -