• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[B&S] DefaultTableCellRenderer and awt

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK,
Thanks!


Marco
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic