Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NB Platform - Vertical align in OutlineView

 
Daniel Jablonski
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Is it possible to set vertical align in CellRenderer which i use in my OutlineView ?

I was trying with something like this, but it doesnt work:



Number formatting and background color work perfect, but i cant change text aligment (((((
 
Tony Docherty
Bartender
Posts: 2989
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is DefaultOutlineCellRenderer? Is it the netbeans class?

If so your problem could be because this class adds a border to indent the text an amount. If you want to provide all your own settings for the returned JLabel then rather than calling super.getTableCellRendererComponent(..) just create a JLabel, configure as you require and return that.

To save unnecessarily creating loads of new JLabels it would be better to create 1 JLabel, store it in an instance variable and reuse it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic