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

📄 test_application_io.java

📁 处学java 用的是jdk
💻 JAVA
字号:
//图形界面输入输出
//test_application_io.java


import java.awt.*;
import java.awt.event.*;

public class test_application_io
{
  public static void main(String [] args)
  {
    new FrameInOut();
  }
}

class FrameInOut extends Frame implements ActionListener
{
  Label prompt;
  TextField input,output;
  
  FrameInOut()
  {
    super("第一个java application界面---输入输出"); 
    prompt = new Label("输入大名:"); 
    input = new TextField(8);
    output = new TextField(20);
    setLayout(new FlowLayout());
    add(prompt);
    add(input);
    add(output);
    input.addActionListener(this);
    setSize(300,200);
    show();
  }
  public void actionPerformed(ActionEvent e)
  {
    output.setText(input.getText()+",你奶奶的/:~");
  }
}

⌨️ 快捷键说明

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