diff --git a/src/java/davmail/ui/AboutFrame.java b/src/java/davmail/ui/AboutFrame.java index 14086126..5da40a56 100644 --- a/src/java/davmail/ui/AboutFrame.java +++ b/src/java/davmail/ui/AboutFrame.java @@ -35,7 +35,7 @@ public class AboutFrame extends JFrame { imageLabel.setIcon(icon); JPanel imagePanel = new JPanel(); imagePanel.add(imageLabel); - add("West", imagePanel); + add(BorderLayout.WEST, imagePanel); } catch (IOException e) { DavGatewayTray.error("Unable to create icon", e); } @@ -66,7 +66,7 @@ public class AboutFrame extends JFrame { JPanel mainPanel = new JPanel(); mainPanel.add(jEditorPane); - add("Center", mainPanel); + add(BorderLayout.CENTER, mainPanel); JPanel buttonPanel = new JPanel(); JButton ok = new JButton("OK"); @@ -79,7 +79,7 @@ public class AboutFrame extends JFrame { buttonPanel.add(ok); - add("South", buttonPanel); + add(BorderLayout.SOUTH, buttonPanel); pack(); setResizable(false); diff --git a/src/java/davmail/ui/AcceptCertificateDialog.java b/src/java/davmail/ui/AcceptCertificateDialog.java index 0672855d..e2292cb0 100644 --- a/src/java/davmail/ui/AcceptCertificateDialog.java +++ b/src/java/davmail/ui/AcceptCertificateDialog.java @@ -10,7 +10,9 @@ import java.awt.event.ActionListener; import java.lang.reflect.InvocationTargetException; import java.security.cert.X509Certificate; import java.text.SimpleDateFormat; +import java.text.DateFormat; import java.util.Date; +import java.util.Locale; /** * Accept certificate dialog @@ -36,7 +38,7 @@ public class AcceptCertificateDialog extends JDialog { public AcceptCertificateDialog(X509Certificate certificate) { setAlwaysOnTop(true); String sha1Hash = DavGatewayX509TrustManager.getFormattedHash(certificate); - SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); + DateFormat formatter = DateFormat.getDateInstance(DateFormat.MEDIUM); setTitle("DavMail: Accept certificate ?"); try { diff --git a/src/java/davmail/ui/SettingsFrame.java b/src/java/davmail/ui/SettingsFrame.java index 581fc5bf..150dd08e 100644 --- a/src/java/davmail/ui/SettingsFrame.java +++ b/src/java/davmail/ui/SettingsFrame.java @@ -328,7 +328,7 @@ public class SettingsFrame extends JFrame { tabbedPane.add("Advanced", advancedPanel); - add("Center", tabbedPane); + add(BorderLayout.CENTER, tabbedPane); JPanel buttonPanel = new JPanel(); JButton cancel = new JButton("Cancel"); @@ -388,7 +388,7 @@ public class SettingsFrame extends JFrame { buttonPanel.add(cancel); buttonPanel.add(help); - add("South", buttonPanel); + add(BorderLayout.SOUTH, buttonPanel); pack(); //setResizable(false); diff --git a/src/java/davmail/ui/tray/AwtGatewayTray.java b/src/java/davmail/ui/tray/AwtGatewayTray.java index 2401da56..c0d910d7 100644 --- a/src/java/davmail/ui/tray/AwtGatewayTray.java +++ b/src/java/davmail/ui/tray/AwtGatewayTray.java @@ -18,6 +18,10 @@ import java.awt.event.ActionListener; * Tray icon handler based on java 1.6 */ public class AwtGatewayTray implements DavGatewayTrayInterface { + protected static final String TRAY2_PNG = "tray2.png"; + protected static final String TRAY_PNG = "tray.png"; + protected static final String TRAYINACTIVE_PNG = "trayinactive.png"; + protected AwtGatewayTray() { } @@ -126,9 +130,9 @@ public class AwtGatewayTray implements DavGatewayTrayInterface { // get the SystemTray instance SystemTray tray = SystemTray.getSystemTray(); - image = DavGatewayTray.loadImage("tray.png"); - image2 = DavGatewayTray.loadImage("tray2.png"); - inactiveImage = DavGatewayTray.loadImage("trayinactive.png"); + image = DavGatewayTray.loadImage(TRAY_PNG); + image2 = DavGatewayTray.loadImage(TRAY2_PNG); + inactiveImage = DavGatewayTray.loadImage(TRAYINACTIVE_PNG); // create a popup menu PopupMenu popup = new PopupMenu(); diff --git a/src/java/davmail/ui/tray/FrameGatewayTray.java b/src/java/davmail/ui/tray/FrameGatewayTray.java index e8f59902..30dc71a5 100644 --- a/src/java/davmail/ui/tray/FrameGatewayTray.java +++ b/src/java/davmail/ui/tray/FrameGatewayTray.java @@ -192,8 +192,8 @@ public class FrameGatewayTray implements DavGatewayTrayInterface { } image = DavGatewayTray.loadImage("tray.png"); - image2 = DavGatewayTray.loadImage("tray2.png"); - inactiveImage = DavGatewayTray.loadImage("trayinactive.png"); + image2 = DavGatewayTray.loadImage(AwtGatewayTray.TRAY2_PNG); + inactiveImage = DavGatewayTray.loadImage(AwtGatewayTray.TRAYINACTIVE_PNG); mainFrame = new JFrame(); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); diff --git a/src/java/davmail/ui/tray/SwtGatewayTray.java b/src/java/davmail/ui/tray/SwtGatewayTray.java index 60300d2b..658b6875 100644 --- a/src/java/davmail/ui/tray/SwtGatewayTray.java +++ b/src/java/davmail/ui/tray/SwtGatewayTray.java @@ -143,8 +143,8 @@ public class SwtGatewayTray implements DavGatewayTrayInterface { awtImage = DavGatewayTray.loadImage("tray.png"); image = loadSwtImage("tray.png"); - image2 = loadSwtImage("tray2.png"); - inactiveImage = loadSwtImage("trayinactive.png"); + image2 = loadSwtImage(AwtGatewayTray.TRAY2_PNG); + inactiveImage = loadSwtImage(AwtGatewayTray.TRAYINACTIVE_PNG); trayItem.setImage(image);