Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
    Bookmark Topic Watch Topic
  • New Topic

problem with actionlistener

 
jeevansai jinne
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am trying to make an applet to convert timezones but was getting problem of implementing actionlistener in other class.

This works



But if i split actionlistener into different class like this it do not work .








But both code are same Can someone figure out my mistake not only this code i was unable to implement actionlistener in seperate class in any code everytime i was getting some error but not know why can someone suggest how to implement object oriented methodology properly .
 
Tony Docherty
Bartender
Posts: 3054
59
  • Mark post as helpful
  • send pies
  • Report post to moderator
My comments from your other thread on this subject still stand.

Your class called 'action' (which should be called something like TimeAction - note the upper case first letter and the reason it's not just Action is there is a class in the javax.swing package called Action and whilst duplicate class names in different packages is ok it can getting confusing) should not be extending Clock - what are you trying to achieve by doing so?
If you have extended Clock in the hope it will be able to access the variables declared in the Clock applet you are mistaken as it will be accessing different instances of the variables.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please continue any discussion your other topic on this matter.
 
    Bookmark Topic Watch Topic
  • New Topic