112 editor.selectAll();
113 editor.requestFocus();
114 }
115
116 // This used to do something but now it doesn't. It couldn't be
117 // removed because it would be an API change to do so.
118 public void focusGained(FocusEvent e) {}
119
120 // This used to do something but now it doesn't. It couldn't be
121 // removed because it would be an API change to do so.
122 public void focusLost(FocusEvent e) {}
123
124 public void addActionListener(ActionListener l) {
125 editor.addActionListener(l);
126 }
127
128 public void removeActionListener(ActionListener l) {
129 editor.removeActionListener(l);
130 }
131
132 static class BorderlessTextField extends JTextField {
133 public BorderlessTextField(String value,int n) {
134 super(value,n);
135 }
136
137 // workaround for 4530952
138 public void setText(String s) {
139 if (getText().equals(s)) {
140 return;
141 }
142 super.setText(s);
143 }
144
145 public void setBorder(Border b) {
146 if (!(b instanceof UIResource)) {
147 super.setBorder(b);
148 }
149 }
150 }
151
|
112 editor.selectAll();
113 editor.requestFocus();
114 }
115
116 // This used to do something but now it doesn't. It couldn't be
117 // removed because it would be an API change to do so.
118 public void focusGained(FocusEvent e) {}
119
120 // This used to do something but now it doesn't. It couldn't be
121 // removed because it would be an API change to do so.
122 public void focusLost(FocusEvent e) {}
123
124 public void addActionListener(ActionListener l) {
125 editor.addActionListener(l);
126 }
127
128 public void removeActionListener(ActionListener l) {
129 editor.removeActionListener(l);
130 }
131
132 @SuppressWarnings("serial") // Superclass is not serializable across versions
133 static class BorderlessTextField extends JTextField {
134 public BorderlessTextField(String value,int n) {
135 super(value,n);
136 }
137
138 // workaround for 4530952
139 public void setText(String s) {
140 if (getText().equals(s)) {
141 return;
142 }
143 super.setText(s);
144 }
145
146 public void setBorder(Border b) {
147 if (!(b instanceof UIResource)) {
148 super.setBorder(b);
149 }
150 }
151 }
152
|