• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Vertical JLable

 
Derrick Albers
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some code that uses VerticalUI to create a vertical JLabel. The code works great after the program is running and you replace the panel with the JLabel, but before that replace the JLabel text is normal, the UI's paint method is not called when the JLabel is created. How can I force a paint() or create a JLabel with vertical text that will show the text vertical from the beginning, I have tried calling paint(this.getGraphics,this) and the graphics object is always null???
Label Code:

VerticalUI code:
 
Rob Camick
Ranch Hand
Posts: 2580
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't post your simple test program that actually creates and displays the label.
 
Derrick Albers
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a lot of code is why.
 
Rob Camick
Ranch Hand
Posts: 2580
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't ask for your real application. I asked for a test frame. Its called a SSCCE.

It takes about 4 lines of code to create a JFrame. Another couple of lines of code to add a JLabel to it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic