window.java

来自「笔记的管理」· Java 代码 · 共 39 行

JAVA
39
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package bt;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.*;/** * * @author Administrator */public class window extends JFrame implements ActionListener { private JFrame f; private JButton button;     private JTextArea outputArea;     public  void print(String sq){    f=new JFrame("内容");         f.setSize(640,480);          f.setVisible(true);         button=new JButton("确定"); button.addActionListener((ActionListener) this);    outputArea=new JTextArea(20,20);     JPanel p=new JPanel();       p.add(outputArea);       p.add(button);       f.add(p,BorderLayout.CENTER);        outputArea.setText("");        outputArea.append(sq+"\n");    }    public void actionPerformed(ActionEvent e) {        bton b=new bton();         f.setVisible(false);    }}

⌨️ 快捷键说明

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