aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JLabel , image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JLabel , image" Watch "JLabel , image" New topic
Author

JLabel , image

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I have a picture, then I slice into four small pictures, save them into four image file. then I put each image into a JLabel, the four JLabel with image put into JPanel and show up.

But, the result is, the GUI is not exactly as the picture. I don't know why ? My goal is , to get action listener on each image area.

Pat Hays
Ranch Hand

Joined: Aug 20, 2004
Posts: 138
It seems your code is generated by JFrameBuilder.
Try this way, using multiple Panel and BoxLayout instead.


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

Joined: Dec 23, 2003
Posts: 798
Your solution works. But I don't know why we need so many panels. Or we just use NULLLayout.

I am trying the JFramBuilder from Mars3000.com. I like its light weight, esay-use. I hope it has more swing component supports and nicer event handling. All in all, it is a good product.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JLabel , image