trayMenuMain = new MenuItem("Hide"); trayMenuMain.addActionListener(arg0 -> toggleTrayClick()); MenuItem trayMenuAbout = new MenuItem("About " + mainFrame.getTitle()); trayMenuAbout.addActionListener(arg0 -> { StringBuilder about = new StringBuilder(); about.append("<html><h1>") .append(mainFrame.getTitle()) .append("</h1>"); about.append("Download albums from various websites:"); int response = JOptionPane.showConfirmDialog(null, about.toString(), mainFrame.getTitle(), JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, mainIcon = ImageIO.read(getClass().getClassLoader().getResource("icon.png")); trayIcon = new TrayIcon(mainIcon); trayIcon.setToolTip(mainFrame.getTitle()); trayIcon.setImageAutoSize(true); trayIcon.setPopupMenu(trayMenu);
mainFrame.toFront(); mainFrame.setAlwaysOnTop(true); trayIcon.displayMessage(mainFrame.getTitle(), "Started ripping " + ripper.getURL().toExternalForm(), MessageType.INFO); mainFrame.setAlwaysOnTop(false);
/** * Return the title of the AlignmentJmol window. */ public String getTitle(){ return frame.getTitle(); }
/** * @see AbstractComponentProperty#getPropertyValueFromComponent() */ @Override protected String getPropertyValueFromComponent() { return component.getTitle(); }
@Override public void windowClosing(WindowEvent e) { m_FramedOutput.remove(jf.getTitle()); jf.dispose(); } });
JFrame frame = new JFrame("Hello swing"); JPanel panel = new JPanel(); int len = frame.getTitle().length(); Dimension dimension = new Dimension(200 + 7*len, 200); panel.setPreferredSize(dimension);
private boolean titleMatches(Component component) { if (component instanceof JFrame) { String title = ((JFrame) component).getTitle(); return ObjectUtils.nullSafeEquals(title, expectedNameOrTitle); } return false; }
/** * Gets the Title attribute of the SkinWindowWindow object * * @return The Title value */ public String getTitle() { String title = ""; if (frame != null) title = frame.getTitle(); else if (dialog != null) title = dialog.getTitle(); return title; }
public void run() { log.severe(format("Error while operating on RouteConverter service: %s, %s", t, printStackTrace(t))); showMessageDialog(frame, MessageFormat.format(RouteConverter.getBundle().getString("route-service-error"), t.getClass(), getLocalizedMessage(t)), frame.getTitle(), JOptionPane.WARNING_MESSAGE); } });
public void handleOpenError(final Throwable throwable, final List<URL> urls) { invokeLater(() -> { String dialogUrls = printArrayToDialogString(urls.toArray(), true); log.severe("Open error from " + dialogUrls + ": " + throwable + "\n" + printStackTrace(throwable)); showMessageDialog(frame, new JLabel(MessageFormat.format(getBundle().getString("open-error"), dialogUrls, getLocalizedMessage(throwable))), frame.getTitle(), ERROR_MESSAGE); }); }
public void showMapException(String mapName, Exception e) { log.severe("Cannot display map " + mapName + ": " + getLocalizedMessage(e)); showMessageDialog(getFrame(), format(getBundle().getString("cannot-display-map"), mapName, e), getFrame().getTitle(), ERROR_MESSAGE); } }
private static boolean checkForFeature(String featureName, String featureDescription) { if (!hasFeature(featureName)) { final RouteConverter r = RouteConverter.getInstance(); showMessageDialog(r.getFrame(), new JLabel(MessageFormat.format(RouteConverter.getBundle().getString("feature-not-available"), featureDescription)), r.getFrame().getTitle(), ERROR_MESSAGE); return false; } return true; }
public void handleRoutingException(Throwable t) { if (t instanceof OutOfMemoryError) handleOutOfMemoryError((OutOfMemoryError) t); else { log.severe("Cannot route position list: " + getLocalizedMessage(t)); showMessageDialog(getFrame(), format(getBundle().getString("cannot-route-position-list"), t), getFrame().getTitle(), ERROR_MESSAGE); } }
@Override public void flashWindow(Window window) { if (pref.isSystemTrayNotificationEnabled()) { trayIcon.setImage(newMessageIcon.getImage()); if (window instanceof JFrame) { ((JFrame) window).setTitle(getCounteredTitle( ((JFrame) window).getTitle(), chatMessageHandler.getUnreadMessages())); } newMessage = true; } }
public void run() { try { doInsertWithRoutingService(routingService, selectedRows); } catch (Exception e) { log.severe("Cannot insert positions: " + getLocalizedMessage(e)); showMessageDialog(getFrame(), format(Application.getInstance().getContext().getBundle().getString("cannot-insert-positions"), e), getFrame().getTitle(), ERROR_MESSAGE); } } });
public static void handleThrowable(Class clazz, Throwable throwable) { log.severe(format("Unhandled throwable in action %s: %s, %s", clazz.getSimpleName(), throwable, printStackTrace(throwable))); showMessageDialog(getFrame(), MessageFormat.format(Application.getInstance().getContext().getBundle(). getString("unhandled-throwable-error"), clazz.getSimpleName(), getLocalizedMessage(throwable), printStackTrace(throwable)), getFrame().getTitle(), ERROR_MESSAGE); } }
private boolean confirmOverwrite(String file) { int confirm = showConfirmDialog(RouteConverter.getInstance().getFrame(), MessageFormat.format(RouteConverter.getBundle().getString("save-confirm-overwrite"), file), RouteConverter.getInstance().getFrame().getTitle(), YES_NO_OPTION); return confirm != YES_OPTION; }
public void run() { showMessageDialog(getFrame(), MessageFormat.format(Application.getInstance().getContext().getBundle(). getString("out-of-memory-error"), limitBefore, limitAfter), getFrame().getTitle(), ERROR_MESSAGE); } });
protected boolean isMatching(JFrame frame1) { return frame1.getTitle().startsWith("OtrosLogViewer") && frame1.isShowing(); } }).using(robot);
@Test void title() { final JFrame frame = JFrameBuilder.builder() .title(TITLE) .build(); assertThat( frame.getTitle(), is(TITLE)); }