Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inclined Text of JLabel

 
kumarjit banerjee
Ranch Hand
Posts: 32
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have worked on some basic application in java swing, such as reading a text from JTextField, or implement some logic on the event generated by JButton. I have gone thorough the topics in the internet of how to create a button of custom shape as compared to JButton which is rectangular in shape. I want to know is there someway to display the text in the JLabel in an inclined way. I have attached an image for clarification. Suppose I want to create JLabel as



It will display the text JLabel as the text in the image (left side)
I want to display the text as in the image at the right side

Please suggest me how can I achieve this.
JLabel.JPG
Left one is the normal inclination and right one that I wanted
[Thumbnail for JLabel.JPG]
 
Luigi Plinge
Ranch Hand
Posts: 441
IntelliJ IDE Scala Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No easy way, but see Rob Camick's page Rotated Icon, and set the label as an icon.

There's an a tutorial on text manipulation here that might be useful, if you see the section "An New Slant on Text" and apply a different AffineTransform.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic