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

📄 graphicsinout.java.bak

📁 半年的java基础联系源码!现在看了破!对于初学java的朋友能帮上忙就用吧
💻 BAK
字号:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class GraphicsInOut extends Applet implements ActionListener
{
    Label prompt;
    TextField input1;
    TextField input2;
    public void init()
    {
        prompt = new Label("Enter two number,press enter!");
        input1 = new TextField(3);
        input2 = new TextField(3);
        add(prompt);
        add(input1);
        add(input2);
        input1.addActionListener(this);
        input2.addActionListener(this);
    }
    public void paint(Graphics g)
    {
        int a,b,c;
        a=Inter.parseInt(input1.getText());
        b=Inter.parseInt(input2.getText()); 
        c=a+b;
        g.drawString("the sum is "+c,60,80);
    }
    public void actionPerformed(ActionEvent e)
    {
        if(e.getSource() ==input2)
          repaint();
    } 
}             

⌨️ 快捷键说明

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