Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Images on JLabels

 
Prachi Vallecha
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48980
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic