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

📄 applicationgraphicsinout.java

📁 这是个Graphics的小示例。
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;

public class ApplicationGraphicsInOut
{
    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(6);
   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 + -