File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [B&S] DefaultTableCellRenderer and awt