79 |
super.installUI(c); |
super.installUI(c); |
80 |
} |
} |
81 |
|
|
82 |
|
/** |
83 |
|
* Receives notification whenever one of the text component's bound |
84 |
|
* properties changes. Here we check for the editable and enabled |
85 |
|
* properties and adjust the background color accordingly. |
86 |
|
* |
87 |
|
* @param event the property change event |
88 |
|
*/ |
89 |
protected void propertyChange(PropertyChangeEvent event) |
protected void propertyChange(PropertyChangeEvent event) |
90 |
{ |
{ |
91 |
// Does nothing by default. |
if (event.getPropertyName().equals("editable")) |
92 |
|
{ |
93 |
|
if (textComponent.isEditable()) |
94 |
|
textComponent.setBackground(background); |
95 |
|
else |
96 |
|
textComponent.setBackground(inactiveBackground); |
97 |
|
} |
98 |
} |
} |
99 |
} |
} |