Skip to content

Commit 017ed66

Browse files
committed
fixes InnerXXXXDialog to remove focus manager calls
1 parent 1eb80e0 commit 017ed66

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed
5 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/javax/swing/JOptionPane.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ public static int showInternalOptionDialog(Component parentComponent, Object mes
13871387
int messageType, Icon icon, Object[] options, Object initialValue) {
13881388
JOptionPane pane = new JOptionPane(message, messageType, optionType, icon, options, initialValue);
13891389
pane.putClientProperty(ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP, Boolean.TRUE);
1390-
Component fo = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
1390+
//Component fo = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
13911391
//
13921392
pane.setInitialValue(initialValue);
13931393

@@ -1435,9 +1435,9 @@ public static int showInternalOptionDialog(Component parentComponent, Object mes
14351435

14361436
Object selectedValue = pane.getValue();
14371437

1438-
if (fo != null && fo.isShowing()) {
1439-
fo.requestFocus();
1440-
}
1438+
// if (fo != null && fo.isShowing()) {
1439+
// fo.requestFocus();
1440+
// }
14411441
if (selectedValue == null) {
14421442
return CLOSED_OPTION;
14431443
}
@@ -1524,7 +1524,8 @@ public static Object showInternalInputDialog(Component parentComponent, Object m
15241524
int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue) {
15251525
JOptionPane pane = new JOptionPane(message, messageType, OK_CANCEL_OPTION, icon, null, null);
15261526
pane.putClientProperty(ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP, Boolean.TRUE);
1527-
Component fo = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
1527+
1528+
// Component fo = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
15281529

15291530
pane.setWantsInput(true);
15301531
pane.setSelectionValues(selectionValues);
@@ -1575,9 +1576,9 @@ public static Object showInternalInputDialog(Component parentComponent, Object m
15751576
}
15761577
}
15771578

1578-
if (fo != null && fo.isShowing()) {
1579-
fo.requestFocus();
1580-
}
1579+
// if (fo != null && fo.isShowing()) {
1580+
// fo.requestFocus();
1581+
// }
15811582
Object value = pane.getInputValue();
15821583

15831584
if (value == UNINITIALIZED_VALUE) {

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14221,7 +14221,7 @@ var minimalObjNames = [ "equals", "equals$O", "hashCode" /*"toString",*/ ];
1422114221
addProto(proto, "finalize", function () {});
1422214222
addProto(proto, "notify", function () {});
1422314223
addProto(proto, "notifyAll", function () {});
14224-
addProto(proto, "wait", function () {alert("Object.wait was called!" + arguments.callee.caller.toString()});
14224+
addProto(proto, "wait", function () {alert("Object.wait was called!" + arguments.callee.caller.toString())});
1422514225
addProto(proto, "to$tring", Object.prototype.toString);
1422614226
addProto(proto, "toString", function () { return (this.__CLASS_NAME__ ? "[" + this.__CLASS_NAME__ + " object]" : this.to$tring.apply(this, arguments)); });
1422714227

0 commit comments

Comments
 (0)