Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with listener in Jlabel  RSS feed

 
tan kian
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my class for a jlabel that implements ActionListener, but it doesnt seem to work at all =( can anyone tell me what i'm doing wrong?

 
Campbell Ritchie
Sheriff
Posts: 53720
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have an ActionListener but haven't added it yet.
IIRC, and I haven't looked it up, you can add action listeners to JLabels, but they will respond to enter keys as well as mouse clicks.
 
tan kian
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh..........stupid mistake haha. thanks =)
 
Campbell Ritchie
Sheriff
Posts: 53720
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have all done that sort of thing, so don't worry about it.
BTW: What are you doing with int ttt? You declare it but don't seem to use it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!