• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Images on JLabels

 
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??
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • 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.
 
Marshal
Posts: 64689
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!