Skip to content

Commit 0a0b5b2

Browse files
hansonrhansonr
authored andcommitted
Applet should not initiate a focus when made visible. It's not a frame.
1 parent 2c6b0ee commit 0a0b5b2

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

sources/net.sf.j2s.java.core/src/java/applet/JSApplet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public void resizeHTML(int width, int height) {
294294
}
295295
}
296296

297-
@SuppressWarnings("deprecation")
297+
@Override
298298
public void 秘resizeOriginal(int width, int height) {
299299
Dimension d = size();
300300
if ((d.width != width) || (d.height != height)) {

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSAppletUI.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,22 @@ public void installUI(JComponent jc) {
2424
null, null, "Panel.font");
2525
}
2626

27+
@Override
2728
public void setVisible(boolean b) {
2829
super.setVisible(b);
29-
if (b) {
30-
setComponentFocus();
31-
}
30+
// No - frames accept focus when made visible, but applets do not,
31+
// since they are visible from the beginning.
32+
// if (b) {
33+
// setComponentFocus();
34+
// }
3235
// System.out.println("JSAppletUI visible " + b);
3336
}
3437

3538
@Override
3639
public void propertyChange(PropertyChangeEvent e) {
37-
Object value = e.getNewValue();
38-
String prop = e.getPropertyName();
40+
// nothing to do here?
41+
// Object value = e.getNewValue();
42+
// String prop = e.getPropertyName();
3943
// System.out.println("JSAPpletUI prop val " + prop + " " + value);
4044
}
4145

0 commit comments

Comments
 (0)