yongjframe.java

来自「200多个自己编的java程序,大家可以学一下.」· Java 代码 · 共 49 行

JAVA
49
字号
/* * yongJFrame.java * * Created on 2004年9月27日, 下午9:38 *//** * * @author  litertiger */import java.awt.*;import javax.swing.*;import java.awt.event.*;class jframe extends JFrame{    JButton button;    JTextArea text;        /** Creates a new instance of yongJFrame */    public jframe() {        setSize(400,400);        setVisible(true);        Container con=getContentPane();        con.setLayout(new FlowLayout());        button=new JButton("ok");        text=new JTextArea(10,20);                con.add(button);        con.add(text);        pack();        addWindowListener(new WindowAdapter()        {            public void windowClosing(WindowEvent e)            {                System.exit(0);            }        });                }    }    public class yongJFrame{    public static void main(String args[])    {    jframe f=new jframe();    }    }

⌨️ 快捷键说明

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