• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionCommand with JLabel

 
P Jain
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
imageLabel is some JLabel......

imageLabel.setActionCommand("imageLabel");
is this command is correct.
 
Joe Ess
Bartender
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you see that command in the documentation?
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi P Jain

"setActionCommand" is a method in AbstractButton, so maybe you were meant to use a Button or JButton class. The method associates a String object with the button that you can later retrieve with a "getActionCommand" method. Very handy when some buttons have identical texts on them.

You can put an image on a JButton.

Ed
[ August 31, 2004: Message edited by: Eddie Vanda ]
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using mouseClicked()
 
P Jain
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! Friends
Thanks, its working.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic