فهرست منبع

Issue #15 GTKLookaAndFeel for Linux

jess 7 سال پیش
والد
کامیت
7f1213e4b4
1فایلهای تغییر یافته به همراه13 افزوده شده و 6 حذف شده
  1. 13 6
      src/ui/view/Main.java

+ 13 - 6
src/ui/view/Main.java

@@ -23,15 +23,22 @@ public class Main {
 	 */
 	public static void main(String[] args) {
 
-		
-		// *Design
-		try {
+		if (!System.getProperty("os.name").startsWith("Linux"))
+			// *Design
+			try {
 			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException
-				| UnsupportedLookAndFeelException e) {
+			} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
-		}
+			}
+		else
+			try {
+				UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+			} catch (ClassNotFoundException | InstantiationException | IllegalAccessException
+					| UnsupportedLookAndFeelException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
 
 		EventQueue.invokeLater(new Runnable() {
 			public void run() {