I’m still not really sure what misconception lead to this class:
public class StatusBar {
private JTextField status;
public void setStatus (String status) {
this.status.setText(status);
}
public void clearStatus () {
this.status.setText("");
}
public JTextField getStatus () {
return this.status;
}
}
I can’t comprehend why they didn’t just extend
JTextField to add their methods instead of doing this weird wrapping. This violation of encapsulation principles really hurts somehow.
Posted by torturedtutor 
Master of time
February 12, 2010I think this comment is unintentionally very amusing:
/** * {@code MyTimer} manages time.<br> * <b>Collaborations:</b><br> * <i>none</i> */ public class MyTimer extends JLabel implements ActionListener { // ... }