This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Inclined Text of JLabel

 
Ranch Hand
Posts: 32
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
[Thumbnail for JLabel.JPG]
Left one is the normal inclination and right one that I wanted
 
Ranch Hand
Posts: 441
Scala IntelliJ IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic