JComponent[] () { final List<JComponent> focusable = new ArrayList<>(); focusable.add(myTypeEditor.getFocusTarget()); focusable.add(myNameEditor.getFocusTarget()); if (myDefaultValueEditor != null) { focusable.add(myDefaultValueEditor.getFocusTarget()); } if (myAnyVar != null) { focusable.add(myAnyVar); } return focusable.toArray(new JComponent[0]); }