Can I turn images into buttons?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Can I turn images into buttons?

  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.

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center