Explorar el Código

Added menu bar support for OSX.

Gilian Joosen hace 11 años
padre
commit
537b1fcf46
Se han modificado 1 ficheros con 10 adiciones y 2 borrados
  1. 10 2
      src/gui/main/Main.java

+ 10 - 2
src/gui/main/Main.java

@@ -10,8 +10,16 @@ import javax.swing.UnsupportedLookAndFeelException;
 public class Main {
 	
 	public static void main(String[] args){
-		//sets the systems look and feels
-		try{
+        
+		//sets the systems look and feels 
+        
+        //osx
+        if(System.getProperties().getProperty("os.name").equals("Mac OS X")) {
+            System.setProperty("apple.laf.useScreenMenuBar", "true");
+            System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Test");
+        }
+
+        try{
 			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 		}catch(ClassNotFoundException | InstantiationException| IllegalAccessException | UnsupportedLookAndFeelException e) {
 			e.printStackTrace();