if (suggestionsPanel.getComponent(i) instanceof SuggestionLabel) { ((SuggestionLabel) suggestionsPanel.getComponent(i)).setFocused(true); autoSuggestionPopUpWindow.toFront(); autoSuggestionPopUpWindow.requestFocusInWindow(); suggestionsPanel.requestFocusInWindow(); if (i < max) { sl.setFocused(true); autoSuggestionPopUpWindow.toFront(); autoSuggestionPopUpWindow.requestFocusInWindow(); suggestionsPanel.requestFocusInWindow(); container.toFront(); container.requestFocusInWindow(); textField.requestFocusInWindow();
/** * Attempts to send the find dialog to the front of the screen. */ public void toFront() { find.toFront(); }
public void run() { win.toFront(); win.setVisible(true); } });
public void windowLostFocus(WindowEvent e) { end = System.currentTimeMillis(); long elapsed = end - start; //System.out.println(elapsed); if (elapsed < 100) window.toFront(); window.removeWindowFocusListener(this); } }
@Override public void windowOpened(WindowEvent e) { e.getWindow().toFront(); } });
/** * Invoked when a window has been opened. */ public void windowOpened( final WindowEvent e ) { e.getWindow().toFront(); } }
java.awt.Dialog awtDialog = ... Shell shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.NO_TRIM); shell.setSize(0, 0); shell.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { awtDialog.requestFocus(); awtDialog.toFront(); } });
public void run() { win.toFront(); win.setVisible(true); } });
public void mousePressed(MouseEvent ev) { Point dragWindowOffset = ev.getPoint(); Component w = (Component) ev.getSource(); if (isWindow) ((Window) floatingContainer).toFront(); dragOffsetX = dragWindowOffset.x; dragOffsetY = dragWindowOffset.y; dragWidth = w.getWidth(); dragHeight = w.getHeight(); dragCursor = getCursor(calculateCorner(w, dragWindowOffset.x, dragWindowOffset.y)); }
import javax.swing.JFrame; public class NewClass1 { public static void main(String[] args) { JFrame frame = new JFrame("On Top"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(100, 100); frame.setVisible(true); frame.toFront(); } }
private void closeAndReturn() { SwingUtilities.invokeLater(() -> { setVisible(false); owner.toFront(); owner = null; dispose(); }); }
@RunsInEDT private static void doMoveToFront(final @Nonnull Window w) { execute(() -> w.toFront()); }
/** * Brings all added windows to the front, without giving them focus. */ private void updateOnTop() { for (final Window w : ontop) { w.setAutoRequestFocus(false); w.toFront(); w.setAutoRequestFocus(true); } }
public void run() { if (!tested) { uninstall(); if (retry < 3) { // try 3 times to regain the focus Window w = JXLoginPane.this.getTLA(); if (w != null) { w.toFront(); } cot.runTest(); retry++; } } } });
@RunsInEDT static void activateWindow(final @Nonnull Window w) { execute(() -> { w.toFront(); w.requestFocusInWindow(); }); }
@Override protected void finished() { view.setEnabled(true); SwingUtilities.getWindowAncestor(view.getComponent()).toFront(); if (oldFocusOwner != null) { oldFocusOwner.requestFocus(); } } });
@Override protected void finished() { view.setEnabled(true); SwingUtilities.getWindowAncestor(view.getComponent()).toFront(); if (oldFocusOwner != null) { oldFocusOwner.requestFocus(); } } });
public static void endLongComputation(Window window) { computationCount--; if (computationCount == 0) { window.setCursor(Cursor.getDefaultCursor()); window.toFront(); computationMessageWindow.setVisible(false); } }