private void toggleVisibility(MenuItem showMenuItem) { // Hide/Unhide the window if the user clicked in the system tray icon or // selected the menu option if (frame.isVisible()) { frame.setVisible(false); showMenuItem.setLabel("Show"); } else { frame.setVisible(true); frame.setState(Frame.NORMAL); showMenuItem.setLabel("Hide"); } }
public void windowActivated(WindowEvent windowEvent) { // TODO: this is a kludge to fix a window iconify issue // For some reason when I click on the window button, the main UI // window doesn't deiconify. This fix doesn't allow me to iconify the // window by clicking the window button, but it's better than the // alternative frame.setState(Frame.NORMAL); }
public class Myclass{ JFrame frame; public MyClass(JFrame aFrame){ this.frame = aFrame; } public void Frame_normal{ frame.setState(Frame.NORMAL); } } MyClass class = new Myclass(theJFrame); class.Frame_normal();
public void windowDeiconified(WindowEvent windowEvent) { // TODO: this is a kludge to fix a window iconify issue // For some reason when I click on the window button, the main UI // window doesn't deiconify. This fix doesn't allow me to iconify the // window by clicking the window button, but it's better than the // alternative frame.setState(Frame.NORMAL); }
JButton button = (JButton)e.getSource(); Window window = SwingUtilities.windowForComponent( button ); JFrame frame = (JFrame)window; frame.setState(JFrame.ICONIFIED);
/** * Sets the Icon attribute of the SkinWindowWindow object * * @param b The new Icon value */ public void setIcon(boolean b) { if (frame != null) { frame.setState(Frame.ICONIFIED); //frame.show(); } else if (dialog != null) { // not support by dialog } }
JFrame f = new JFrame("Test"); f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); while (true) { f.setVisible(true); f.setState(JFrame.NORMAL); try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } }
public void minimiseAllWindows() { for (SwingController controller : controllers) { JFrame frame = controller.getViewerFrame(); if (frame != null) frame.setState(Frame.ICONIFIED); } }
JFrame frame = new JFrame(); frame.setSize( 800, 600 ); frame.setUndecorated( false ); // will enable animations frame.setVisible( true ); try { Thread.sleep( 3000 ); } catch ( Throwable t ) {} frame.setState( Frame.ICONIFIED );
JFrame frame = new JFrame("test"); frame.setExtendedState(JFrame.ICONIFIED); // one way frame.setState(JFrame.ICONIFIED); // another way
public void bringWindowToFront(int index) { if (index >= 0 && index < controllers.size()) { SwingController controller = controllers.get(index); JFrame frame = controller.getViewerFrame(); if (frame != null) { frame.setState(Frame.NORMAL); frame.toFront(); } } }
@Override public void windowClosing(WindowEvent e) { JFrame f = (JFrame) e.getWindow(); if (f.getState() != JFrame.ICONIFIED) f.setState(JFrame.ICONIFIED); else f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
public void bringAllWindowsToFront(SwingController frontMost) { JFrame frontMostFrame = null; for (SwingController controller : controllers) { JFrame frame = controller.getViewerFrame(); if (frame != null) { if (frontMost == controller) { frontMostFrame = frame; continue; } frame.setState(Frame.NORMAL); frame.toFront(); } } if (frontMostFrame != null) { frontMostFrame.setState(Frame.NORMAL); frontMostFrame.toFront(); } }
@Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { if (!autoSyncWithEditor && !entryList.isEmpty()) { getActiveDisplayedEntry().gotoEntryInEditor(); JFrame frame = Core.getMainWindow().getApplicationFrame(); frame.setState(JFrame.NORMAL); frame.toFront(); } } } });
public void blinkFrameIfNecessary(final JFrame frame) { final MainWindow mainWindow = SparkManager.getMainWindow(); if (mainWindow.isFocusOwner()) { frame.setVisible(true); } else { // Set to new tab. if (Spark.isWindows()) { frame.setState(Frame.ICONIFIED); SparkManager.getNativeManager().flashWindow(frame); frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent e) { SparkManager.getNativeManager().stopFlashing(frame); } }); } } }
void jumpToSelectedIssue() { getSelectedIssue().map(IIssue::getSegmentNumber).ifPresent(i -> { Core.getEditor().gotoEntry(i); JFrame mwf = Core.getMainWindow().getApplicationFrame(); mwf.setState(JFrame.NORMAL); mwf.toFront(); }); }
synchronized void refreshData(int jumpToEntry, List<String> jumpToTypes) { reset(); if (!frame.isVisible()) { // Don't call setVisible if already visible, because the window will // steal focus frame.setVisible(true); } frame.setState(JFrame.NORMAL); panel.progressBar.setValue(0); panel.progressBar.setMaximum(Core.getProject().getAllEntries().size()); panel.progressBar.setVisible(true); panel.progressBar.setEnabled(true); loader = new IssueLoader(jumpToEntry, jumpToTypes); loader.execute(); }
private void go(String destination) { frame.setState(JFrame.ICONIFIED); mediaPlayer.media().play(MRL, getMediaOptions(destination)); }
@Override public void actionPerformed(ActionEvent e) { if (frame instanceof JInternalFrame) { JInternalFrame internalF = (JInternalFrame) frame; try { internalF.setSelected(true); if (internalF.isIcon()) internalF.setIcon(false); internalF.moveToFront(); } catch (PropertyVetoException e1) { e1.printStackTrace(); } } else if (frame instanceof LauncherFrame) { LauncherFrame launcher = (LauncherFrame) frame; launcher.getJFrame().setState(Frame.NORMAL); launcher.getJFrame().toFront(); } } }