📄 exerciseone.java
字号:
/*
* @(#)Exerciseone.java 1.0 04/06/04
*
* You can modify the template of this file in the
* directory ..\JCreator\Templates\Template_2\Project_Name.java
*
* You can also create your own project template by making a new
* folder in the directory ..\JCreator\Template\. Use the other
* templates as examples.
*
*/
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class Exerciseone extends Applet implements ActionListener{
Image image;
TextField tf;
String str;
public void init() {
tf=new TextField(30);
add(tf);
tf.addActionListener(this);
}
public void paint(Graphics g) {
image=getImage(this.getDocumentBase(),str);
g.drawImage(image,50,60,this);
}
public void actionPerformed(ActionEvent ae){
str=tf.getText();
repaint();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -