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

📄 welcome.java

📁 创建带有标签和文本域的窗体。当用户在文本域中输入其姓名后
💻 JAVA
字号:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class welcome extends Applet implements ActionListener
{
      Label prompt;
      TextField input,output;

      public void init()
      {
         prompt = new Label("请输入您的名字:");
         input = new TextField(6);
         output = new TextField(30);
         add(prompt);
         add(input);
         add(output);
         input.addActionListener(this);
       }
       public void actionPerformed(ActionEvent e)
       {
         output.setText("你好,"+input.getText()+",欢迎你使用java编程!");
       }
} 

⌨️ 快捷键说明

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