actionlistener

hi all

i want to call a method from SuperMethods.java which is called

"trysScored"

public String trysScored(Super14[] myTeam)

and display its output in jTextArea1 which i have also created in a GUI

i have created a aswell and here is the code. i know what is in there isnt right but it was just some of the things i was trying to do to get it to work but pretty much dont have a clue....

any help would be great!

privatevoid jButton1ActionPerformed(java.awt.event.ActionEvent evt){

SuperMethods worker =new SuperMethods();

String input = jTextArea1.getText().trim();

//if input is integer or double then use Integer.parseInt()

jTextArea1.setText(input);

}

[922 byte] By [confusedboya] at [2007-11-27 8:57:39]
# 1
* I have created a button aswellsorry
confusedboya at 2007-7-12 21:22:32 > top of Java-index,Java Essentials,New To Java...
# 2

The method needs to be called actionPerformed and should be inside a class that implements ActionListener or make an anonymous class.

The jTextArea should already be created in you GUI class. So all your actionPerformed method needs to do is update the jTextArea or call a method that can do it.

floundera at 2007-7-12 21:22:32 > top of Java-index,Java Essentials,New To Java...