View Single Post
  #8 (permalink)  
Old 06-27-2009, 12:43 PM
Gajesh Tripathi Gajesh Tripathi is offline
Member
 
Join Date: Aug 2007
Posts: 38
Rep Power: 0
Gajesh Tripathi is on a distinguished road
Default JLabel can not be slected
Originally Posted by Eranga View Post
The way serjant explain is really nice.

On the other way, which I explain you can use labels easily on the frame, and add images to those labels. That's the most easiest way I can see.
I have already tried it but Two problem with Label is:-
1. We can not select JLable
2. Text/Caption is not appearing at the bottom of Image Label however text position property is set.


Quote:
Use a GridLayout with JButtons that have setContentAreaFilled(false) and setBorderPainted(false). You may also want to setRolloverEnabled(false).

Set an icon and text to each button, and setHorizontalTextPosition(SwingConstants.CENTER) / setVerticalTextPosition(SwingConstants.TOP)
Thanks Burke, I will try it; I hope JButton is best to solve my problem and your idea will work.
Reply With Quote