• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[B&S] DefaultTableCellRenderer and awt

 
Marco Santinon
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I used a custom DefaultTableCellRenderer to display altern color lines in the JTable.
To do this, I had to override method

public java.awt.Component getTableCellRendererComponent(JTable table,
Object value,
boolean selected,
boolean focus,
int row,
int col)

but it returns a java.awt.Component!

Can this cause trouble with the request of not use java.awt.Component?

Tecnically speaking I'm not using it, but it is in the import!

What do you think?


Thanks in advance

Marco
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think the requirement is to "not use the AWT components" when the quivalent is available in SWING...

I would say you can use this unless there's an upgrade for it in SWING. Virtually all SWING classes inherits java.awt.Component, this is not a problem..

Example: you cannot t use Button since JButton exists..

Regards,
Alex
 
Marco Santinon
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK,
Thanks!


Marco
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic