This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes ActionCommand with JLabel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ActionCommand with JLabel" Watch "ActionCommand with JLabel" New topic
Author

ActionCommand with JLabel

P Jain
Ranch Hand

Joined: Jul 31, 2004
Posts: 52
Hi!
imageLabel is some JLabel......

imageLabel.setActionCommand("imageLabel");
is this command is correct.


Regards<br />P Jain
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

Do you see that command in the documentation?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
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 ]

The nice thing about Standards is that there are so many to choose from!
Pat Hays
Ranch Hand

Joined: Aug 20, 2004
Posts: 138
Using mouseClicked()


Download Java GUI Builder, <a href="http://www.mars3000.com" target="_blank" rel="nofollow">http://www.mars3000.com</a>
P Jain
Ranch Hand

Joined: Jul 31, 2004
Posts: 52
Hi! Friends
Thanks, its working.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionCommand with JLabel
 
Similar Threads
Click On Image.
Image in JFrame ???
Working with Image Icon
Where should I put the applet?
Layout ,scrollbar problem