0

Are there any rational pros and cons on using one class acting as both TableCellEditor and TableCellRenderer? I'm not asking for preferences or "which way is more popular", but rather if there are some inherent issues with that design (other than possibly being confusing).

Edit 1: Additionally, are there any performance concerns involved in choosing between one class to be both renderer and editor versus simply having both renderer and editor classes in the same Java file?

It seems odd to me to have one object wearing both editor and renderer hats at the same time, but oddness alone isn't a reason for me to not pursue this pattern.

Igeryu
  • 11
  • 3
  • When you provide a sophisticated design for a cell, it could be a preferred way to implement renderer and editor in one class. In other cases you probably get implementation overhead, but I see here no design problems. – Sergiy Medvynskyy Oct 07 '16 at 14:08
  • I guess this question could also be extended to also ask if there are any performance issues/concerns that are different between using **one** class as both renderer and editor versus simply having the editor class and its associated renderer class in the same **file** – Igeryu Oct 07 '16 at 14:28
  • 2
    In case of correct implementation you'll get no performance issues. – Sergiy Medvynskyy Oct 07 '16 at 14:42

0 Answers0