-
Image Button
Is there any way to place an image on a Button? Or is this not
possible?
-
Re: Image Button
Rocco Balsamo <rbalsamo@hillier.com> wrote in message
news:3922D43D.8E712E15@hillier.com...
> Is there any way to place an image on a Button? Or is this not possible?
>
Copied from the documentation for class JButton:
-----------------start copy----------------------------
JButton
public JButton(Icon icon)
Creates a button with an icon.
Parameters:
icon - the Icon image to display on the button
-----------------end copy-----------------------------
However, if you can't use Swing the answer appears to be No. But I suppose
you might be able to create a class that extends Button by making the button
transparent or invisible or something (override the paint() method to do
nothing?), placing the object of your class on top of your chosen Image, and
getting button clicks when the user thinks they're clicking on the image.
Haven't tried this myself, just an idea.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks