This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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: 14688
    
  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: 4987
    
    8

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.
 
Have you checked out Aspose?
 
subject: removing space for text in JLabel . . .
 
It's not a secret anymore!