This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes NB Platform - Vertical align in OutlineView Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "NB Platform - Vertical align in OutlineView" Watch "NB Platform - Vertical align in OutlineView" New topic
Author

NB Platform - Vertical align in OutlineView

Daniel Jablonski
Greenhorn

Joined: Sep 17, 2012
Posts: 1
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

Joined: Aug 07, 2007
Posts: 2161
    
  47
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: NB Platform - Vertical align in OutlineView
 
Similar Threads
changing text color in cell
JTable header problem
align right in JTable
Color in JTable
JTable Table Cell Renderer Problem