|
67 | 67 | */ |
68 | 68 | public class MainFrame extends javax.swing.JFrame implements ActionListener, UserInterface { |
69 | 69 |
|
| 70 | + private static final long serialVersionUID = 1L; |
| 71 | + |
70 | 72 | private ApplicationController appController; |
71 | 73 |
|
72 | 74 | private int tomcatPort = UserInterface.DEFAULT_TOMCAT_PORT; |
@@ -118,7 +120,7 @@ public void windowClosing(java.awt.event.WindowEvent evt) { |
118 | 120 |
|
119 | 121 | setStatus(UserInterface.STATUS_MESSAGE_STARTING); |
120 | 122 |
|
121 | | - int preferredMetaKey = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); |
| 123 | + int preferredMetaKey = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx(); |
122 | 124 |
|
123 | 125 | fileMenu.setText("File"); |
124 | 126 | browserMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, preferredMetaKey)); |
@@ -298,14 +300,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { |
298 | 300 |
|
299 | 301 | try{ |
300 | 302 | if (System.getProperty("os.name").startsWith("Mac OS X")) { |
301 | | - Class noparams[] = {}; //no paramater |
302 | | - Class[] paramImage = new Class[1]; //Image parameter |
| 303 | + Class<?>[] noparams = {}; |
| 304 | + Class<?>[] paramImage = new Class<?>[1]; |
303 | 305 | paramImage[0] = Image.class; |
304 | | - Class Application = Class.forName("com.apple.eawt.Application"); |
305 | | - Object application = Application.newInstance(); |
306 | | - Method getApplication = Application.getDeclaredMethod("getApplication", noparams); |
307 | | - application = getApplication.invoke(null, null); |
308 | | - Method setDockIconImage = Application.getDeclaredMethod("setDockIconImage", paramImage); |
| 306 | + Class<?> applicationClass = Class.forName("com.apple.eawt.Application"); |
| 307 | + Method getApplication = applicationClass.getDeclaredMethod("getApplication", noparams); |
| 308 | + Object application = getApplication.invoke(null, (Object[]) null); |
| 309 | + Method setDockIconImage = applicationClass.getDeclaredMethod("setDockIconImage", paramImage); |
309 | 310 | ImageIcon image = new ImageIcon(getClass().getResource("openmrs_logo_white.gif")); |
310 | 311 | setDockIconImage.invoke(application, image.getImage()); |
311 | 312 | } |
|
0 commit comments