" + Resources.format(Messages.HELP_ABOUT_DIALOG_JAVA_VERSION, (vmName +", "+ vmVersion)) + "
" + urlStr + ""); helpLink.setOpaque(false); helpLink.setEditable(false); helpLink.setForeground(textColor); mainPanel.setBorder(BorderFactory.createLineBorder(borderColor)); infoAndLogoPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); helpLink.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { browse(e.getDescription()); } } }); infoAndLogoPanel.add(helpLink, NORTH); ImageIcon brandLogoIcon = new ImageIcon(getClass().getResource("resources/brandlogo.png")); JLabel brandLogo = new JLabel(brandLogoIcon, JLabel.LEADING); JButton closeButton = new JButton(closeAction); JPanel bottomPanel = new TPanel(0, 0); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING)); buttonPanel.setOpaque(false); mainPanel.add(infoAndLogoPanel, CENTER); cp.add(bottomPanel, SOUTH); infoAndLogoPanel.add(brandLogo, SOUTH); buttonPanel.setBorder(new EmptyBorder(2, 12, 2, 12)); buttonPanel.add(closeButton); bottomPanel.add(buttonPanel, NORTH); statusBar = new JLabel(" "); bottomPanel.add(statusBar, SOUTH); cp.add(mainPanel, NORTH); pack(); setLocationRelativeTo(jConsole); Utilities.updateTransparency(this); } public void showDialog() { statusBar.setText(" "); setVisible(true); try { // Bring to front of other dialogs setSelected(true); } catch (PropertyVetoException e) { // ignore } } private static AboutDialog getAboutDialog(JConsole jConsole) { if (aboutDialog == null) { aboutDialog = new AboutDialog(jConsole); } return aboutDialog; } static void showAboutDialog(JConsole jConsole) { getAboutDialog(jConsole).showDialog(); } static void browseUserGuide(JConsole jConsole) { getAboutDialog(jConsole).browse(getOnlineDocUrl()); } static boolean isBrowseSupported() { return (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)); } void browse(String urlStr) { try { Desktop.getDesktop().browse(new URI(urlStr)); } catch (Exception ex) { showDialog(); statusBar.setText(ex.getLocalizedMessage()); if (JConsole.isDebug()) { ex.printStackTrace(); } } } private void createActions() { closeAction = new AbstractAction(Messages.CLOSE) { public void actionPerformed(ActionEvent ev) { setVisible(false); statusBar.setText(""); } }; } private static String getOnlineDocUrl() { String version = Integer.toString(jdkMinorVersion()); return Resources.format(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL, version); } private static class TPanel extends JPanel { TPanel(int hgap, int vgap) { super(new BorderLayout(hgap, vgap)); setOpaque(false); } } }