mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 11:31:33 +01:00
Use Nimbus theme on the applet
See https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html
This commit is contained in:
parent
69206ef89b
commit
3f0b5e0045
|
@ -23,6 +23,7 @@ import guibase.GUIInterface;
|
|||
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
|
||||
import chess.ComputerPlayer;
|
||||
import chess.Move;
|
||||
|
@ -55,10 +56,23 @@ public class AppletGUI extends javax.swing.JApplet implements GUIInterface {
|
|||
}
|
||||
}
|
||||
|
||||
private static void setNimbusAsTheme() {
|
||||
try {
|
||||
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
|
||||
if ("Nimbus".equals(info.getName())) {
|
||||
UIManager.setLookAndFeel(info.getClassName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry point for the GUI version of the chess program.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
setNimbusAsTheme();
|
||||
javax.swing.JApplet theApplet = new AppletGUI();
|
||||
theApplet.init();
|
||||
javax.swing.JFrame window = new javax.swing.JFrame(ComputerPlayer.engineName);
|
||||
|
|
Loading…
Reference in New Issue
Block a user