-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Look and feel is now set to be cross platform
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,32 @@ | ||
package test; | ||
|
||
import javax.swing.UIManager; | ||
import javax.swing.UnsupportedLookAndFeelException; | ||
|
||
import view.CheckersWindow; | ||
|
||
public class GUITest { | ||
|
||
public static void main(String[] args) { | ||
|
||
// Need to set the look and feel for this to be cross platform | ||
try { | ||
// Set cross-platform Java L&F (also called "Metal") | ||
UIManager.setLookAndFeel( | ||
UIManager.getCrossPlatformLookAndFeelClassName()); | ||
} | ||
catch (UnsupportedLookAndFeelException e) { | ||
// handle exception | ||
} | ||
catch (ClassNotFoundException e) { | ||
// handle exception | ||
} | ||
catch (InstantiationException e) { | ||
// handle exception | ||
} | ||
catch (IllegalAccessException e) { | ||
// handle exception | ||
} | ||
CheckersWindow window = new CheckersWindow(); | ||
} | ||
} |