DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    1

    Question Can I turn images into buttons?

    Hey, for my AP Computer Science project I am trying to create a game. I made the background for it in Photoshop and imported the image BUT I have no idea how (if I can at all) to turn the .jpg buttons I made in Photoshop seperately into buttons that I can click on and do things with. It is really annoying me because I can't get the buttons the awt thing provides me with to get in the right spots. Someone PLEASE help me. Thanks, .
    meh

  2. #2
    Join Date
    Feb 2004
    Posts
    541
    You can add an ImageIcon to a JButton as a parameter in one of its constructors. Check the API for JButton, and also ImageIcon.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links