📄 frmtest.java~17~
字号:
import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.JFrame;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author unascribed * @version 1.0 */public class frmTest extends JFrame { JTextArea theArea=null; public frmTest() { super("菜单练习"); theArea=new JTextArea(); theArea.setEditable(true) ; this.getContentPane() .add(new JScrollPane(theArea)) ; JMenuBar mbar=new JMenuBar(); mbar.setOpaque(true) ; JMenu thefile=new JMenu("file"); JMenuItem newf=new JMenuItem("new",new ImageIcon("./images/javaIcon.gif")); thefile.add(newf) ; mbar.add(thefile) ; setJMenuBar(mbar); double s=Math.exp(2); System.out.println(Math.pow(2.7182818284590455,2)); System.out.println(s); } public static void main(String[] args){ JFrame f=new frmTest(); //f.setSize(400,400) ; f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e){ System.exit(0); } }); f.setVisible(true) ; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -