Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Images on JLabels Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Images on JLabels" Watch "Images on JLabels" New topic
Author

Images on JLabels

Prachi Vallecha
Greenhorn

Joined: Sep 16, 2010
Posts: 4
i have to use an image on a JLabel...but the image is non-rectangular.
so on using the image,the boundaries of the label are visible.
is there some way to to get non-rectangular labels??
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

1. An Image can't be non-rectangular. Maybe your image has some transparent pixels.
2. JLabel does not by default have a Border and is by default non-opaque, so if the
boundaries of the label are visible

that must be because of something in your own code.

To get better help sooner, post a SSCCE. Preferably link to a suitable image resource on the internet (for example http://www.coderanch.com/templates/default/images/moosefly.gif) so that members can run your SSCCE to see where the problem might be.


luck, db
There are no new questions, but there may be new answers.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38075
    
  22
. . . and welcome to the Ranch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Images on JLabels
 
Similar Threads
help needed to reshape an image
AWT Window with background
Why this code does not generate any exception?
how to create non rectangular window
adding picture as background to a frame