wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes [B&S] DefaultTableCellRenderer and awt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "[B&S] DefaultTableCellRenderer and awt" Watch "[B&S] DefaultTableCellRenderer and awt" New topic
Author

[B&S] DefaultTableCellRenderer and awt

Marco Santinon
Greenhorn

Joined: Jan 03, 2007
Posts: 17
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

Joined: Apr 26, 2005
Posts: 516
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

Joined: Jan 03, 2007
Posts: 17
OK,
Thanks!


Marco
 
 
subject: [B&S] DefaultTableCellRenderer and awt
 
Similar Threads
JTable Table Cell Renderer Problem
Color in JTable
JTable
Jtable cells
Color Some particular rows in JTable