mirror of
				https://github.com/lov3b/Schack.git
				synced 2025-11-04 07:00:21 +01:00 
			
		
		
		
	Only embed if supported
This commit is contained in:
		@@ -23,7 +23,8 @@ public class Schack {
 | 
				
			|||||||
        try {
 | 
					        try {
 | 
				
			||||||
//            FlatSolarizedLightIJTheme.setup();
 | 
					//            FlatSolarizedLightIJTheme.setup();
 | 
				
			||||||
            FlatLightLaf.setup();
 | 
					            FlatLightLaf.setup();
 | 
				
			||||||
            System.setProperty("flatlaf.menuBarEmbedded", "true");
 | 
					            embedMenuBarIfSupported();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        } catch (Exception cantThemeWithFlatLaf) {
 | 
					        } catch (Exception cantThemeWithFlatLaf) {
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 | 
					                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 | 
				
			||||||
@@ -85,7 +86,22 @@ public class Schack {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public static void main(String[] args) throws IOException {
 | 
					    public static void main(String[] args) throws IOException {
 | 
				
			||||||
        new Schack();
 | 
					        new Schack();
 | 
				
			||||||
new Schack();
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private void embedMenuBarIfSupported() {
 | 
				
			||||||
 | 
					        // Currently only supported in Windows 10+
 | 
				
			||||||
 | 
					        String os = System.getProperty("os.name");
 | 
				
			||||||
 | 
					        if (os.contains("Windows")) {
 | 
				
			||||||
 | 
					            String versionNumberStr = os.split(" ")[1];
 | 
				
			||||||
 | 
					            try {
 | 
				
			||||||
 | 
					                int versionNumber = Integer.parseInt(versionNumberStr);
 | 
				
			||||||
 | 
					                if (versionNumber >= 10) {
 | 
				
			||||||
 | 
					                    System.setProperty("flatlaf.menuBarEmbedded", "true");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            } catch (Exception e) {
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user