void (@NotNull AnActionEvent event) { if (frame != null && frame.isVisible()) { frame.dispose(); frame = null; } else { if (frame == null) { frame = new JFrame("Test Text Fields"); frame.add(new View()); frame.pack(); frame.setLocationRelativeTo(null); } frame.setVisible(true); frame.toFront(); } }