File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
sources/net.sf.j2s.java.core/src/java/awt Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,8 @@ public AppContext getAppContext() {
358358 */
359359 private int isFocusTraversableOverridden = FOCUS_TRAVERSABLE_UNKNOWN ;
360360
361+ protected boolean _isFocusableSet ; // SwingJS added
362+
361363 /**
362364 * The focus traversal keys. These keys will generate focus traversal behavior
363365 * for Components for which focus traversal keys are enabled. If a value of null
@@ -5400,7 +5402,7 @@ protected void processFocusEvent(FocusEvent e) {
54005402 */
54015403 protected void processKeyEvent (KeyEvent e ) {
54025404 KeyListener listener = keyListener ;
5403- if (listener != null ) {
5405+ if (listener != null && ( /** @j2sNative this.isAWT$ || */ _isFocusableSet ) ) {
54045406 int id = e .getID ();
54055407 switch (id ) {
54065408 case KeyEvent .KEY_TYPED :
@@ -6049,6 +6051,8 @@ public void setFocusable(boolean focusable) {
60496051 this .focusable = focusable ;
60506052 }
60516053 isFocusTraversableOverridden = FOCUS_TRAVERSABLE_SET ;
6054+
6055+ _isFocusableSet = true ;
60526056
60536057 firePropertyChange ("focusable" , Boolean .valueOf (oldFocusable ), Boolean .valueOf (focusable ));
60546058 if (oldFocusable && !focusable ) {
You can’t perform that action at this time.
0 commit comments