librejack

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

commit 1974a3e34661a4580dc6b947742e6d97a285d52f
parent ec46973c3036b2150b32dd292c4dbc854649db36
Author: Michael Neuper <73108749+michaelneuper@users.noreply.github.com>
Date:   Sun, 12 Feb 2023 21:11:32 +0200

Switch to lambda expression

Diffstat:
Msrc/controller/LoginController.java | 2+-
Msrc/view/LoginGUI.form | 31+++++++++++++++++++++++++++++++
Msrc/view/LoginGUI.java | 19+++++++++++++++----
Msrc/view/MainGUI.java | 6++----
4 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/src/controller/LoginController.java b/src/controller/LoginController.java @@ -14,7 +14,7 @@ public class LoginController { public boolean areAllFieldsValid(String email, String mobileNumber, String password) { return -// isValidEmail(email) && + isValidEmail(email) && isValidSouthAfricanMobileNumber(mobileNumber) && isValidPassword(password); } diff --git a/src/view/LoginGUI.form b/src/view/LoginGUI.form @@ -1,8 +1,22 @@ <?xml version="1.0" encoding="UTF-8" ?> <Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <NonVisualComponents> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="cc" red="33" type="rgb"/> + </Property> + </Properties> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/> + </Container> + </NonVisualComponents> <Properties> <Property name="defaultCloseOperation" type="int" value="3"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="99" green="99" red="99" type="rgb"/> + </Property> <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[829, 786]"/> </Property> @@ -21,6 +35,7 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,3,54,0,0,4,-118"/> </AuxValues> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> @@ -183,6 +198,9 @@ </Component> <Component class="javax.swing.JButton" name="jButtonVerify"> <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Font name="Dialog" size="48" style="1"/> </Property> @@ -265,5 +283,18 @@ <Property name="useNullLayout" type="boolean" value="false"/> </Layout> </Container> + <Component class="javax.swing.JLabel" name="jLabelCardsImage"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/assets/cards_icon.png"/> + </Property> + <Property name="text" type="java.lang.String" value="jLabel6"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="440" y="160" width="680" height="520"/> + </Constraint> + </Constraints> + </Component> </SubComponents> </Form> diff --git a/src/view/LoginGUI.java b/src/view/LoginGUI.java @@ -2,6 +2,7 @@ package view; import controller.LoginController; + /** * * @author Michael @@ -26,6 +27,7 @@ public class LoginGUI extends javax.swing.JFrame { // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + jPanel3 = new javax.swing.JPanel(); jLabelWelcome = new javax.swing.JLabel(); jLabelLogin = new javax.swing.JLabel(); jLabelEmail = new javax.swing.JLabel(); @@ -46,8 +48,12 @@ public class LoginGUI extends javax.swing.JFrame { jLabelDateOfBirth = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); + jLabelCardsImage = new javax.swing.JLabel(); + + jPanel3.setBackground(new java.awt.Color(51, 204, 0)); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setBackground(new java.awt.Color(153, 153, 153)); setMinimumSize(new java.awt.Dimension(829, 786)); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); @@ -106,6 +112,7 @@ public class LoginGUI extends javax.swing.JFrame { jLabel4.setText("- 1 special character"); getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 609, -1, -1)); + jButtonVerify.setBackground(new java.awt.Color(204, 204, 204)); jButtonVerify.setFont(new java.awt.Font("Dialog", 1, 48)); // NOI18N jButtonVerify.setText("PLAY"); jButtonVerify.addActionListener(new java.awt.event.ActionListener() { @@ -139,6 +146,10 @@ public class LoginGUI extends javax.swing.JFrame { jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(454, 735, -1, -1)); + jLabelCardsImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/assets/cards_icon.png"))); // NOI18N + jLabelCardsImage.setText("jLabel6"); + getContentPane().add(jLabelCardsImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 160, 680, 520)); + pack(); }// </editor-fold>//GEN-END:initComponents @@ -194,10 +205,8 @@ public class LoginGUI extends javax.swing.JFrame { //</editor-fold> /* Create and display the form */ - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new LoginGUI().setVisible(true); - } + java.awt.EventQueue.invokeLater(() -> { + new LoginGUI().setVisible(true); }); } @@ -208,6 +217,7 @@ public class LoginGUI extends javax.swing.JFrame { private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabelCardsImage; private javax.swing.JLabel jLabelDateOfBirth; private javax.swing.JLabel jLabelEmail; private javax.swing.JLabel jLabelLogin; @@ -218,6 +228,7 @@ public class LoginGUI extends javax.swing.JFrame { private javax.swing.JLabel jLabelWelcome; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; private javax.swing.JPasswordField jPasswordField; private javax.swing.JTextField jTextFieldEmail; private javax.swing.JTextField jTextFieldMobileNumber; diff --git a/src/view/MainGUI.java b/src/view/MainGUI.java @@ -307,10 +307,8 @@ public class MainGUI extends javax.swing.JFrame { //</editor-fold> /* Create and display the form */ - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new MainGUI().setVisible(true); - } + java.awt.EventQueue.invokeLater(() -> { + new MainGUI().setVisible(true); }); }