!7 p { JDesktopPane desktop = jDesktopPane(); final JTextField tfInput = jCenteredTextField(); showFrame(northAndCenter(tfInput, desktop)); installInternalFrameSwitcher_v3(desktop).shouldSwitch = func -> bool { isFocusedComponent(tfInput) }; addInternalFrame(desktop, "Test", jTextArea()); addInternalFrame(desktop, "Test 2", jTextArea()); addInternalFrame(desktop, "Test 3", jTextArea()); }