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

📄 test.java

📁 swing 教程,与大家分享一下,哈哈,希望大家多多指教
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Test extends JApplet {
	public Test() {
		Container contentPane = getContentPane();
		JToolBar tb = new JToolBar();
		JComboBox fontCombo = new JComboBox(),
					fontSizeCombo = new JComboBox();

		JButton newButton = new JButton(new ImageIcon("new.gif")),
			openButton = new JButton(new ImageIcon("open.gif")),
			cutButton = new JButton(new ImageIcon("cut.gif")),
			copyButton = new JButton(new ImageIcon("copy.gif")),
			pasteButton = new JButton(new ImageIcon("paste.gif"));

		fontCombo.addItem("Helvetica");
		fontCombo.addItem("Palatino");
		fontCombo.addItem("Courier");
		fontCombo.addItem("Times");
		fontCombo.addItem("Times-Roman");

		fontSizeCombo.addItem("10");
		fontSizeCombo.addItem("12");
		fontSizeCombo.addItem("14");
		fontSizeCombo.addItem("16");
		fontSizeCombo.addItem("18");

		tb.add(newButton);
		tb.add(openButton);

		tb.addSeparator();

		tb.add(cutButton);
		tb.add(copyButton);
		tb.add(pasteButton);

		tb.addSeparator();

		tb.add(fontCombo);
		tb.add(fontSizeCombo);

		contentPane.setLayout(new BorderLayout());
		contentPane.add(tb, BorderLayout.NORTH);
	}
}

⌨️ 快捷键说明

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