Results 1 to 2 of 2
  1. #1
    asambasamba is offline Member
    Join Date
    Jun 2008
    Posts
    1
    Rep Power
    0

    Default 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)

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    Java Code:
    public class Conversie extends Applet implements ActionListener {
        // Java does not recognize this method signature as being part
        // of the ActionListener interface.
        public void actionPerformed(ActionEvent e, Graphics g) {
            ...
        // This method signature is defined in the ActionListener interface.
        public void actionPerformed(ActionEvent e) {

Similar Threads

  1. Total Newbie, Be Kind :)
    By dazza-s in forum New To Java
    Replies: 11
    Last Post: 04-26-2008, 10:54 PM
  2. Printing total out
    By denisdoherty in forum New To Java
    Replies: 1
    Last Post: 04-25-2008, 06:40 AM
  3. beginner to Java
    By notwist in forum New To Java
    Replies: 15
    Last Post: 04-18-2008, 09:41 AM
  4. Beginner-Moderate IDE
    By Hiro ZA in forum NetBeans
    Replies: 4
    Last Post: 01-26-2008, 06:16 AM
  5. beginner needs help with OBD-II input
    By andrewos in forum New To Java
    Replies: 3
    Last Post: 07-30-2007, 09:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •