Subclass « Component « Java Swing Q&A





1. What did the creators of Swing have against subclassing Swing components? (RANT!)    coderanch.com

First of all, I must scream: Aaaaaarrrrrrgggggghhhhh!!! I'm trying to move some AWT-based legacy code to Swing. The old code uses it's own mark-up format to do the same sorts of things you can do by setting a JLabel to "blah blah blah...". Despite being old creaky AWT-base code, this mark-up system has two nice features you don't get with an ...

2. Change Swing Component Subclass    coderanch.com

I have an abstract "GridCell" class that extends JLabel and two subclasses of this class: "EmptyGridCell" and "NonEmptyGridCell" that are the same except for the background and the border colors. Basically, when I click an "EmptyGridCell" it has to become a "NonEmptyGridCell" and vice versa which means the component has to change its color and text. The program runs but the ...