From 6edad6a5ad3909136e2cd9628dffb913e3055d1b Mon Sep 17 00:00:00 2001 From: Brian Hinz Date: Sat, 12 Jan 2013 01:20:53 +0000 Subject: [PATCH] Make the icon used for the titlebar consistent for About... dialog git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5026 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- java/com/tigervnc/vncviewer/CConn.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java index 610aef98..63db1ab4 100644 --- a/java/com/tigervnc/vncviewer/CConn.java +++ b/java/com/tigervnc/vncviewer/CConn.java @@ -730,12 +730,18 @@ public class CConn extends CConnection Window fullScreenWindow = Viewport.getFullScreenWindow(); if (fullScreenWindow != null) Viewport.setFullScreenWindow(null); - JOptionPane.showMessageDialog((viewport != null ? viewport : null), + String msg = String.format(VncViewer.aboutText, VncViewer.version, VncViewer.build, - VncViewer.buildDate, VncViewer.buildTime), - "About TigerVNC Viewer for Java", - JOptionPane.INFORMATION_MESSAGE, - logo); + VncViewer.buildDate, VncViewer.buildTime); + JOptionPane op = + new JOptionPane(msg, JOptionPane.INFORMATION_MESSAGE, + JOptionPane.DEFAULT_OPTION, logo); + JDialog dlg = op.createDialog("About TigerVNC Viewer for Java"); + ClassLoader cl = this.getClass().getClassLoader(); + ImageIcon icon = + new ImageIcon(cl.getResource("com/tigervnc/vncviewer/tigervnc.ico")); + dlg.setIconImage(icon.getImage()); + dlg.setVisible(true); if (fullScreenWindow != null) Viewport.setFullScreenWindow(fullScreenWindow); } -- 2.39.5