|
total beginner needs little help
hey im a total beginner at java and what I am now trying to accomplish is a textarea and a button, and when you press the button the content of the textarea appears on the screen (so not in another textarea)
what I have now is:
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class Conversie extends Applet
implements ActionListener {
TextField invoer;
Button conversieknop;
public void init() {
invoer = new TextField(20);
conversieknop = new Button("omzetten");
conversieknop.addActionListener(this);
add(invoer);
add(conversieknop);
}
public void actionPerformed(ActionEvent e, Graphics g) {
if(e.getSource() == conversieknop) {
String invoerstring;
int getal1;
int getal2;
invoerstring = invoer.getText();
getal1 = Integer.parseInt(invoerstring);
g.drawString("" + getal1, 0, 300);
}
}
}
The error i keep getting is:
The type Conversie must implement the inherited abstract method ActionListener.actionPerformed(ActionEvent)
|