File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Suppress the Cell color change on Focus

 
guilhem Haentjens
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Want to use a DefaultTableModel and I succes
to set the color I wanted to on the selected rows.
The problem is that the cell on Focus keep White With "DefaultTableModel" and I don't want to.
For information :
Before usinng DefaultTableModel I try with an simple implementation of "AbstractTableModel" And I din't have this PB but "DefaultTableModel" may be more interresting for other things.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DefaultTableModel shouldn't control the colors of the table... it just holds the data...

Maybe you are asking about DefaultTableCellRenderer?

If you want to keep the focus and color that DefaultTableCellRenderer and just add some more you can call super.getTableCellRendererComponent() with all the parameters that got passed into your getTableCellRendererComponent() method, cast the component you get back to a JLabel, mess with that JLabel and then return it.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic