librejack

Blackjack clone written in java
git clone https://github.com/michaelneuper/librejack.git
README | Files | Log | Refs | LICENSE

commit 4de91250839802374e3630bf515ec88da87ec494
parent 82e183cebb34f58ab62deea1f1d1ebd7545690f5
Author: Michael Neuper <michael@michaelneuper.com>
Date:   Sat, 29 Apr 2023 23:20:01 +0200

Change to FlatLaf look and feel

Diffstat:
Alib/flatlaf-3.1.1.jar | 0
Mnbproject/project.properties | 5++++-
Msrc/view/Login.java | 22++++++----------------
3 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/lib/flatlaf-3.1.1.jar b/lib/flatlaf-3.1.1.jar Binary files differ. diff --git a/nbproject/project.properties b/nbproject/project.properties @@ -36,6 +36,7 @@ dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= file.reference.commons-lang3-3.12.0.jar=/home/michael/Downloads/commons-lang3-3.12.0/commons-lang3-3.12.0.jar +file.reference.flatlaf-3.1.1.jar=/home/michael/Downloads/flatlaf-3.1.1.jar file.reference.jcalendar-1.4.jar=/home/michael/Downloads/jcalendar-1.4/lib/jcalendar-1.4.jar file.reference.opencsv-5.7.1.jar=/home/michael/Downloads/opencsv-5.7.1.jar includes=** @@ -46,7 +47,8 @@ javac.classpath=\ ${libs.absolutelayout.classpath}:\ ${file.reference.jcalendar-1.4.jar}:\ ${file.reference.opencsv-5.7.1.jar}:\ - ${file.reference.commons-lang3-3.12.0.jar} + ${file.reference.commons-lang3-3.12.0.jar}:\ + ${file.reference.flatlaf-3.1.1.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -117,6 +119,7 @@ run.test.modulepath=\ ${javac.test.modulepath} source.encoding=UTF-8 source.reference.commons-lang3-3.12.0.jar=lib/commons-lang3-3.12.0.jar +source.reference.flatlaf-3.1.1.jar=lib/flatlaf-3.1.1.jar source.reference.jcalendar-1.4.jar=lib/jcalendar-1.4.jar source.reference.opencsv-5.7.1.jar=lib/opencsv-5.7.1.jar src.dir=src diff --git a/src/view/Login.java b/src/view/Login.java @@ -1,7 +1,10 @@ package view; +import com.formdev.flatlaf.FlatDarkLaf; import controller.LoginController; import java.util.Date; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; /** * GUI for login screen. @@ -362,24 +365,11 @@ public class Login extends javax.swing.JFrame { * @param args the command line arguments */ public static void main(String args[]) { - /* Set the Nimbus look and feel */ - //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> - /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. - * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html - */ + /* Set the FlatDarkLaf look and feel */ try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); - break; - } - } - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + UIManager.setLookAndFeel(new FlatDarkLaf()); + } catch (UnsupportedLookAndFeelException e) { } - //</editor-fold> - - //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(() -> {