This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying Text Vertically  RSS feed

 
Raghuveer Rawat
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
In my application, In each JFrame I have set BorderLayout Manager.
In the West of these BorderLayout I want to set Company Name in Vertical Text. Can anyone tell me how I can do it.
 
Dorothy Finkel-Laverty
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just did this today with my class - you can set it up as a label, with the html tags : like this - -
JLabel right = new JLabel("<html>This <br>is<br> the<br> East<br> panel</html>");
Or any other HTML tags that make sense.
 
Frank Slade
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the method as suggested in the reply posted earlier or you can create a UI class that can be used to draw text vertically.
subclass BasicLabelUI and write your text vertically over there. Each Letter at a time.
Like this.
C
I
S
C
O
public void paint(Graphics g, JComponent c) {
//do your text writing here
}
This solution works for Swing JLabel etc,
you can over ride the paint method for your AWT component.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!