aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes removing space for text in JLabel . . . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "removing space for text in JLabel . . ." Watch "removing space for text in JLabel . . ." New topic
Author

removing space for text in JLabel . . .

Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

when displaying a JLabel with only icon, there is some reserved space for text even the text is "".
So, how to display a JLabel by completely filled with icon only?
Thank you.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

What about setText(null) ?


[My Blog]
All roads lead to JavaRanch
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

Result is same, by setting the text to null !
Thanks for your response.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4530
    
    5

sanjeev charla wrote:when displaying a JLabel with only icon, there is some reserved space for text even the text is "".

No there isn't.
So, how to display a JLabel by completely filled with icon only?

Post a SSCCE that demonstrates the problem.

edit For example, this SSCCE shows that there isn't a problem.


luck, db
There are no new questions, but there may be new answers.
 
jQuery in Action, 2nd edition
 
subject: removing space for text in JLabel . . .