Java compilation error with BlueJ -
for practicing purpose, trying re-create , paste programme book , find out result still brings me compilation error: "cannot find symbol - class actionlistner"
.
my compiler if bluej. code is:
import java.awt.*; import java.awt.event.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; public class ex3 { public static void main (string[] args) { f f = new f (" exemplul 3 "); f.setsize(300, 100); f.setvisible(true); } } class f extends frame implements actionlistner { label l1, l2; textfield t1, t2; button b; int c1, c2; f(string s) { settitle(s); setlayout(new flowlayout()); l1 = new label("numar"); add(l1); t1 = new textfield("0"); add(t1); l2 = new label("plus "); add(l2); t2 = new textfield("0"); add(t2); b = new button("adauga"); add(b); b.addactionlistner(this); } public void actionperformed(actionevent e) { c2 = integer.parseint (t2.gettext()); c1 += c2; t1.setext(integer.tostring(c1)); } }
can give clue error, please? btw: please note 1st java code. lot.
it's typo. class called actionlistener
, not actionlistner
java bluej
No comments:
Post a Comment