commit 7076188f594943cb5a2db11c57a6ea79229ef5d6
parent 148a69c4b50bf662118f0108c0937dc4b2cfaa28
Author: Michael Neuper <73108749+michaelneuper@users.noreply.github.com>
Date: Mon, 17 Oct 2022 15:26:59 +0200
Merge branch 'main' of https://github.com/michaelneuper/librejack
Diffstat:
18 files changed, 798 insertions(+), 197 deletions(-)
diff --git a/assets/background.jpg b/assets/background.jpg
Binary files differ.
diff --git a/docs/specification/main.tex b/docs/specification/main.tex
@@ -1,93 +0,0 @@
-\documentclass[12pt]{article}
-
-% Language setting
-% Replace `english' with e.g. `spanish' to change the document language
-\usepackage[english]{babel}
-
-% Set page size and margins
-% Replace `letterpaper' with`a4paper' for UK/EU standard size
-\usepackage[a4paper,top=2cm,bottom=2cm,left=2cm,right=2cm,marginparwidth=1.75cm]{geometry}
-
-% Useful packages
-\usepackage{amsmath}
-\usepackage{titlesec}
-\usepackage{titlecaps}
-\usepackage{graphicx}
-\usepackage{fancyhdr}
-\usepackage[utf8x]{inputenc}
-\usepackage[colorlinks=true, allcolors=blue]{hyperref}
-
-% Format titles
-\titleformat{\section}
-{\bfseries\centering\large}
-{§\thesection}
-{1em}
-{}
-\titleformat{\subsection}
-{\bfseries\centering}
-{\thesubsection}
-{1em}
-{}
-
-% Set footer
-\pagestyle{fancy}
-\fancyhf{}
-\fancyhead[LE,RO]{}
-\fancyhead[RE,LO]{\leftmark}
-\fancyfoot[CE,CO]{}
-\fancyfoot[LE,RO]{Bladsy \thepage}
-
-\title{
- \begin{huge}
- Specification Document
- \end{huge}
-\author{Michael Neuper}}
-\date{}
-\pagebreak
-
-\begin{document}
-
-\begin{titlepage}
- \centering
- \vspace*{\fill}
-
- \vspace*{0.5cm}
-
- \Huge\bfseries
- librejack
-
- \LARGE Specification Document
-
- \vspace*{0.5cm}
-
- \Large Michael Neuper
-
- \vspace{6cm}
-
- \begin{quote}
- \large
-
- \textbf{\textit{Libre}} /\char{27}librə/ in English is adopted from the various Romance languages, ultimately descending from the Latin word līber; its origin is closely related to liberty. It denotes `the state of being free', as in `liberty' or `having freedom'
- \end{quote}
-
- \vspace*{\fill}
-\end{titlepage}
-
-\tableofcontents
-\pagebreak
-
-\section{Summary}
-
-\section{Motivation}
-
-\section{Specifications of Program Function}
-
-\section{Specifications of User Interface}
-
-\section{Specification of Help}
-
-\section{Specifications of Data Storage}
-
-\section{Hardware and Software requirements}
-
-\end{document}
-\ No newline at end of file
diff --git a/lib/flatlaf-2.2.jar b/lib/flatlaf-2.2.jar
Binary files differ.
diff --git a/nbproject/private/config.properties b/nbproject/private/config.properties
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
@@ -1,2 +1,6 @@
compile.on.save=true
+do.depend=false
+do.jar=true
+javac.debug=true
+javadoc.preview=true
user.properties.file=/home/michael/.netbeans/8.2/build.properties
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
@@ -3,10 +3,8 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
- <file>file:/home/michael/Projects/PAT/librejack/src/model/Person.java</file>
- <file>file:/home/michael/Projects/PAT/librejack/src/model/Dealer.java</file>
- <file>file:/home/michael/Projects/PAT/librejack/src/model/Player.java</file>
<file>file:/home/michael/Projects/PAT/librejack/src/controller/Controller.java</file>
+ <file>file:/home/michael/Projects/PAT/librejack/src/view/Main.java</file>
</group>
</open-files>
</project-private>
diff --git a/nbproject/project.properties b/nbproject/project.properties
@@ -1,9 +1,11 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
-annotation.processing.processor.options=
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.desc=A blackjack clone written in java
+application.title=librejack
+application.vendor=michael
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
@@ -26,10 +28,14 @@ dist.archive.excludes=
dist.dir=dist
dist.jar=${dist.dir}/librejack.jar
dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
excludes=
includes=**
+jar.archive.disabled=${jnlp.enabled}
jar.compress=false
-javac.classpath=
+jar.index=${jnlp.enabled}
+javac.classpath=\
+ ${libs.absolutelayout.classpath}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -54,11 +60,29 @@ javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
+jnlp.codebase.type=no.codebase
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.mixed.code=default
+jnlp.offline-allowed=false
+jnlp.signed=false
+jnlp.signing=
+jnlp.signing.alias=
+jnlp.signing.keystore=
main.class=view.Main
+# Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found.
+manifest.custom.application.library.allowable.codebase=
+# Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts.
+manifest.custom.caller.allowable.codebase=
+# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
+manifest.custom.codebase=
+# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
+manifest.custom.permissions=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
+project.license=gpl30
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
diff --git a/src/controller/Controller.java b/src/controller/Controller.java
@@ -1,7 +1,5 @@
package controller;
-import javax.swing.JOptionPane;
-
import model.Dealer;
import model.Deck;
import model.Player;
@@ -31,17 +29,41 @@ public class Controller {
losses = 0;
pushes = 0;
balance = 1000.0;
+ bet = 100.0;
- deck = new Deck(); // creates new populated deck
+ // create new populated deck
+ deck = new Deck();
deck.populate();
deck.shuffle();
- discarded = new Deck(); // creates new empty deck
-
+ // create new empty deck
+ discarded = new Deck();
+
+ // create new dealer and player
dealer = new Dealer();
player = new Player();
}
+ public double getBet() {
+ return bet;
+ }
+
+ public void setBet(double bet) {
+ if(bet < balance) {
+ this.bet = bet;
+ } else { // in case they try to make a bet bigger than their balance
+ System.out.println("You don't have that much money"); // TODO: change to message dialog
+ }
+ }
+
+ public double getBalance() {
+ return balance;
+ }
+
+ public void setBalance(double balance) {
+ this.balance = balance;
+ }
+
/**
* Handles logic for each round
*
@@ -49,23 +71,14 @@ public class Controller {
public void startRound() {
// if we run out of cards
- if(wins > 0 || losses > 0 || pushes > 0) { // FIXME: remove code :)
+ // if(wins > 0 || losses > 0 || pushes > 0) { // FIXME: change code :)
System.out.println("\nStarting next round...\nWins: " + wins + "\nLosses: " + losses + "\nPushes: " + pushes + "\nBalance: " + balance);
dealer.getHand().discardHandToDeck(discarded);
player.getHand().discardHandToDeck(discarded);
- // make sure deck has at least 4 cards left
- if(deck.cardsLeft() < 4) {
- deck.reloadDeckFromDiscard(discarded);
- }
- }
-
- // ask the player what their bet is
- bet = Double.parseDouble(JOptionPane.showInputDialog("Enter a bet amount"));
-
- if(bet > balance) { // in case the player tries to bet more than they have
- System.out.println("You don't have that much money! Please try again");
- bet = Double.parseDouble(JOptionPane.showInputDialog("Enter a bet amount"));
+ // make sure deck has at least 4 cards left
+ if(deck.cardsLeft() < 4) {
+ deck.reloadDeckFromDiscard(discarded);
}
// give the dealer 2 cards
@@ -75,55 +88,38 @@ public class Controller {
// give the player 2 cards
player.getHand().takeCardFromDeck(deck);
player.getHand().takeCardFromDeck(deck);
+
+ }
- // print their hands
- dealer.printFirstHand();
- player.printHand();
-
+ public String checkWhoWins() {
+
// check if dealer has blackjack
if (dealer.hasBlackjack()) {
dealer.printHand(); // show full hand
if (player.hasBlackjack()) {
-
- System.out.println("You both have 21 - Push");
++pushes;
- startRound();
-
+ return "You both have 21 - Push";
} else {
-
- System.out.println("Dealer has BlackJack. You lose.");
- dealer.printHand();
balance -= bet;
++losses;
- startRound();
+ dealer.printHand();
+ return "Dealer has BlackJack - You lose";
}
}
// check if player has blackjack
if(player.hasBlackjack()) {
- System.out.println("You have BlackJack. You win.");
balance += bet * 1.5;
++wins;
- startRound();
+ return "You have BlackJack - You win";
}
-
- player.makeDecision(deck, discarded);
-
- checkWhoWins();
-
- // start a new round
- startRound();
- }
-
- private void checkWhoWins() { // FIXME: return string
// check whether player busted
if(player.getHand().calculateValue() > 21) {
- System.out.println("Busted");
balance -= bet;
++losses;
- startRound();
+ return "Busted";
}
// dealer's turn
@@ -134,27 +130,84 @@ public class Controller {
// check who wins
if(dealer.getHand().calculateValue() > 21) {
- System.out.println("Dealer busts");
balance += bet;
++wins;
+ return "Dealer busts - You win";
}
if(dealer.getHand().calculateValue() > player.getHand().calculateValue() && dealer.getHand().calculateValue() <= 21) {
- System.out.println("You lose");
balance -= bet;
++losses;
+ return "You lose";
}
if(player.getHand().calculateValue() > dealer.getHand().calculateValue()) {
- System.out.println("You win");
balance += bet;
++wins;
+ return "You win";
}
if(player.getHand().calculateValue() == dealer.getHand().calculateValue()) {
- System.out.println("Push");
++pushes;
+ return "Push";
}
+
+ return "Something went wrong";
+ }
+
+ /**
+ * Hits the player with a card
+ */
+ public void hitPlayer() {
+ player.hit(deck, discarded);
+ }
+
+ /**
+ *
+ * @return player hand
+ */
+ public String displayPlayerHand() {
+ return player.printHand();
+ }
+
+ /**
+ *
+ * @return the value of the player's hand
+ */
+ public String displayPlayerHandValue() {
+ return Integer.toString(player.getHand().calculateValue());
+ }
+
+ /**
+ *
+ * @return dealer hand
+ */
+ public String displayDealerHand() {
+ return dealer.printHand();
+ }
+
+ /**
+ *
+ * @return value of dealer's hand
+ */
+ public String displayDealerHandValue() {
+ return Integer.toString(dealer.getHand().calculateValue());
+ }
+
+ /**
+ *
+ * @return dealer's first card
+ */
+ public String displayDealerFirstCard() {
+ return dealer.printFirstHand();
+ }
+
+ /**
+ *
+ * @return value of the first card
+ */
+ public String displayDealerFirstCardValue() {
+ return dealer.printFirstCardValue();
}
}
diff --git a/src/controller/Hand.java b/src/controller/Hand.java
@@ -23,7 +23,7 @@ public class Hand {
}
/**
- * Mehtod to add a card from the deck to the hand
+ * Adds a card from the deck to the hand
*
* @param deck deck to take card from
*/
@@ -32,7 +32,7 @@ public class Hand {
}
/**
- * Method to calulate the value of a hand
+ * Method to calculate the value of a hand
*
* @return value value of the hand
*/
diff --git a/src/model/Dealer.java b/src/model/Dealer.java
@@ -14,7 +14,11 @@ public class Dealer extends Person {
super.setName("Dealer");
}
- public void printFirstHand() {
- System.out.println("Dealer's hand:\n" + super.getHand().getCard(0));
+ public String printFirstHand() {
+ return "" + super.getHand().getCard(0);
+ }
+
+ public String printFirstCardValue() {
+ return "" + super.getHand().getCard(0).getValue();
}
}
diff --git a/src/model/Deck.java b/src/model/Deck.java
@@ -3,6 +3,8 @@ package model;
import java.util.ArrayList;
import java.util.Random;
+import javax.swing.JOptionPane;
+
import model.Card.Rank;
import model.Card.Suit;
@@ -121,7 +123,7 @@ public class Deck {
this.addCards(discard.getCards());
this.shuffle();
discard.emptyDeck();
- System.out.println("Ran out of cards, creating new deck from discard pile & shuffling deck");
+ System.out.println("Ran out of cards, creating new deck from discard pile & shuffling deck"); // TODO: change to message dialog
}
/**
diff --git a/src/model/Person.java b/src/model/Person.java
@@ -49,8 +49,9 @@ public abstract class Person {
/**
* Prints a formatted version of the person's hand
*/
- public void printHand() {
- System.out.println(this.name + "'s hand:\n" + this.hand + "[" + this.hand.calculateValue() + "]");
+ // TODO: remove print statement
+ public String printHand() {
+ return this.hand + "[" + this.hand.calculateValue() + "]";
}
/**
@@ -61,14 +62,12 @@ public abstract class Person {
*/
public void hit(Deck deck, Deck discard) {
- // if there's no cards left in the deck
+ // if there are no cards left in the deck
if (!deck.hasCards()) {
deck.reloadDeckFromDiscard(discard);
}
this.hand.takeCardFromDeck(deck);
- System.out.println(this.name + " gets a card");
- this.printHand();
}
}
diff --git a/src/model/Player.java b/src/model/Player.java
@@ -14,7 +14,7 @@ import java.util.Scanner;
*/
public class Player extends Person {
- double balance; // TODO: make public
+ private double balance; // TODO: make public
Scanner input = new Scanner(System.in);
/**
@@ -45,45 +45,7 @@ public class Player extends Person {
System.out.println("Error:\n" + e);
}
- this.balance = balance; // TODO: is neccesary?
- }
-
- /**
- * Allows the player to decide to hit or stand
- *
- * @param deck deck to draw from
- * @param discard deck to discard to
- */
- public void makeDecision(Deck deck, Deck discard) {
-
- int decision = 0;
- boolean getNum = true;
-
- while(getNum) {
- try {
- System.out.println("Would you like to Hit[1] or Stand[2]");
- decision = input.nextInt();
- getNum = false;
-
- } catch (Exception e) {
- System.out.println("Error:\n" + e);
- input.next();
- }
- }
-
- // if they decide to hit
- if (decision == 1) { // TODO: add option to double down
-
- this.hit(deck, discard); // hit the deck and discard
-
- if(this.getHand().calculateValue() > 20) {
- return; // return if they have blackjack or busted
- } else {
- this.makeDecision(deck, discard); // allow them to hit or stand if they don't have 21 or blackjack
- }
- } else {
- System.out.println("You stand."); // assume they stand if they hit a number other than 1
- }
+// this.balance = balance; // TODO: is neccesary?
}
}
diff --git a/src/view/GUI.form b/src/view/GUI.form
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="3"/>
+ <Property name="title" type="java.lang.String" value="librejack"/>
+ <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="0" green="66" red="0" type="rgb"/>
+ </Property>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+ <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,19,0,0,5,2"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
+ <Property name="useNullLayout" type="boolean" value="false"/>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel3">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="710" y="110" width="-1" height="-1"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="100" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="100" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Component class="javax.swing.JLabel" name="jLabelBalance">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="14" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code=""Balance: " + game.getBalance()" type="code"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="60" y="470" width="220" height="40"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButtonDouble">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="18" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="DOUBLE DOWN"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonDoubleActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="960" y="510" width="190" height="120"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButtonStand">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="18" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="STAND"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonStandActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="960" y="340" width="190" height="110"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButtonHit">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="18" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="HIT"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonHitActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="960" y="180" width="190" height="110"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButtonDeal">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="48" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="DEAL"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonDealActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="420" y="570" width="460" height="120"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButtonBetAmount">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="14" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Change Bet Amount"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonBetAmountActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="60" y="580" width="220" height="60"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabelCurrentBet">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="14" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code=""Current Bet: " + game.getBet()" type="code"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="60" y="520" width="200" height="50"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabelResult">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="48" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="game.checkWhoWins()" type="code"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="120" y="30" width="1120" height="130"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabelDisplayDealerHand">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="70" y="290" width="440" height="160"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabelDisplayPlayerHand">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="game.displayPlayerHand()" type="code"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="530" y="300" width="400" height="150"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabelDealerHand">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="36" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Dealer's Hand:"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="70" y="250" width="270" height="30"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabelPlayerHand">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="36" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Your Hand:"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="490" y="250" width="210" height="30"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButtonExit">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="EXIT"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonExitActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="1132" y="713" width="120" height="50"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabelDealerHandValue">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="36" style="1"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="360" y="247" width="80" height="40"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabelPlayerHandValue">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="36" style="1"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
+ <AbsoluteConstraints x="720" y="250" width="60" height="40"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ </SubComponents>
+</Form>
diff --git a/src/view/GUI.java b/src/view/GUI.java
@@ -0,0 +1,258 @@
+package view;
+
+import controller.Controller;
+import javax.swing.JOptionPane;
+
+/**
+ *
+ * @author Michael
+ */
+public class GUI extends javax.swing.JFrame {
+
+ Controller game = new Controller();
+
+ /**
+ * Creates new form GUI
+ */
+ public GUI() {
+ initComponents();
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel3 = new javax.swing.JPanel();
+ jLabelBalance = new javax.swing.JLabel();
+ jButtonDouble = new javax.swing.JButton();
+ jButtonStand = new javax.swing.JButton();
+ jButtonHit = new javax.swing.JButton();
+ jButtonDeal = new javax.swing.JButton();
+ jButtonBetAmount = new javax.swing.JButton();
+ jLabelCurrentBet = new javax.swing.JLabel();
+ jLabelResult = new javax.swing.JLabel();
+ jLabelDisplayDealerHand = new javax.swing.JLabel();
+ jLabelDisplayPlayerHand = new javax.swing.JLabel();
+ jLabelDealerHand = new javax.swing.JLabel();
+ jLabelPlayerHand = new javax.swing.JLabel();
+ jButtonExit = new javax.swing.JButton();
+ jLabelDealerHandValue = new javax.swing.JLabel();
+ jLabelPlayerHandValue = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+ setTitle("librejack");
+ setForeground(new java.awt.Color(0, 102, 0));
+ getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
+
+ javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
+ jPanel3.setLayout(jPanel3Layout);
+ jPanel3Layout.setHorizontalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 100, Short.MAX_VALUE)
+ );
+ jPanel3Layout.setVerticalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 100, Short.MAX_VALUE)
+ );
+
+ getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 110, -1, -1));
+
+ jLabelBalance.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
+ jLabelBalance.setText("Balance: " + game.getBalance());
+ getContentPane().add(jLabelBalance, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 470, 220, 40));
+
+ jButtonDouble.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
+ jButtonDouble.setText("DOUBLE DOWN");
+ jButtonDouble.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButtonDoubleActionPerformed(evt);
+ }
+ });
+ getContentPane().add(jButtonDouble, new org.netbeans.lib.awtextra.AbsoluteConstraints(960, 510, 190, 120));
+
+ jButtonStand.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
+ jButtonStand.setText("STAND");
+ jButtonStand.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButtonStandActionPerformed(evt);
+ }
+ });
+ getContentPane().add(jButtonStand, new org.netbeans.lib.awtextra.AbsoluteConstraints(960, 340, 190, 110));
+
+ jButtonHit.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
+ jButtonHit.setText("HIT");
+ jButtonHit.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButtonHitActionPerformed(evt);
+ }
+ });
+ getContentPane().add(jButtonHit, new org.netbeans.lib.awtextra.AbsoluteConstraints(960, 180, 190, 110));
+
+ jButtonDeal.setFont(new java.awt.Font("Dialog", 1, 48)); // NOI18N
+ jButtonDeal.setText("DEAL");
+ jButtonDeal.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButtonDealActionPerformed(evt);
+ }
+ });
+ getContentPane().add(jButtonDeal, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 570, 460, 120));
+
+ jButtonBetAmount.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
+ jButtonBetAmount.setText("Change Bet Amount");
+ jButtonBetAmount.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButtonBetAmountActionPerformed(evt);
+ }
+ });
+ getContentPane().add(jButtonBetAmount, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 580, 220, 60));
+
+ jLabelCurrentBet.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
+ jLabelCurrentBet.setText("Current Bet: " + game.getBet());
+ getContentPane().add(jLabelCurrentBet, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 520, 200, 50));
+
+ jLabelResult.setFont(new java.awt.Font("Dialog", 1, 48)); // NOI18N
+ jLabelResult.setText(game.checkWhoWins());
+ getContentPane().add(jLabelResult, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 30, 1120, 130));
+ getContentPane().add(jLabelDisplayDealerHand, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 290, 440, 160));
+
+ jLabelDisplayPlayerHand.setText(game.displayPlayerHand());
+ getContentPane().add(jLabelDisplayPlayerHand, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 300, 400, 150));
+
+ jLabelDealerHand.setFont(new java.awt.Font("Dialog", 1, 36)); // NOI18N
+ jLabelDealerHand.setText("Dealer's Hand:");
+ getContentPane().add(jLabelDealerHand, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 250, 270, 30));
+
+ jLabelPlayerHand.setFont(new java.awt.Font("Dialog", 1, 36)); // NOI18N
+ jLabelPlayerHand.setText("Your Hand:");
+ getContentPane().add(jLabelPlayerHand, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 250, 210, 30));
+
+ jButtonExit.setText("EXIT");
+ jButtonExit.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButtonExitActionPerformed(evt);
+ }
+ });
+ getContentPane().add(jButtonExit, new org.netbeans.lib.awtextra.AbsoluteConstraints(1132, 713, 120, 50));
+
+ jLabelDealerHandValue.setFont(new java.awt.Font("Dialog", 1, 36)); // NOI18N
+ getContentPane().add(jLabelDealerHandValue, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 247, 80, 40));
+
+ jLabelPlayerHandValue.setFont(new java.awt.Font("Dialog", 1, 36)); // NOI18N
+ getContentPane().add(jLabelPlayerHandValue, new org.netbeans.lib.awtextra.AbsoluteConstraints(720, 250, 60, 40));
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void jButtonDealActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDealActionPerformed
+ jLabelResult.setText(""); // clear the last result
+ jLabelBalance.setText(Double.toString(game.getBalance())); // update the balance
+ game.startRound();
+ jLabelDisplayDealerHand.setText(game.displayDealerFirstCard());
+ jLabelDealerHandValue.setText(game.displayDealerFirstCardValue());
+ printPlayerHand();
+ }//GEN-LAST:event_jButtonDealActionPerformed
+
+ private void jButtonBetAmountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBetAmountActionPerformed
+ game.setBet(Double.parseDouble(JOptionPane.showInputDialog("Enter the bet amount")));
+ jLabelCurrentBet.setText("Current Bet: " + Double.toString(game.getBet()));
+ }//GEN-LAST:event_jButtonBetAmountActionPerformed
+
+ private void jButtonStandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStandActionPerformed
+
+ printDealerHand();
+ jLabelResult.setText(game.checkWhoWins());
+ printDealerHand();
+ jLabelBalance.setText(Double.toString(game.getBalance())); // update the balance
+ }//GEN-LAST:event_jButtonStandActionPerformed
+
+ private void jButtonDoubleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDoubleActionPerformed
+ game.setBet(game.getBet() * 2); // double the bet
+ game.hitPlayer();
+ game.setBet(game.getBet() / 2); // reset bet back to original bet
+ printPlayerHand();
+ printDealerHand();
+ jLabelResult.setText(game.checkWhoWins());
+ jLabelBalance.setText(Double.toString(game.getBalance())); // update the balance
+ }//GEN-LAST:event_jButtonDoubleActionPerformed
+
+ private void jButtonHitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonHitActionPerformed
+ game.hitPlayer();
+ printPlayerHand();
+ printDealerHand();
+ jLabelResult.setText(game.checkWhoWins());
+ jLabelBalance.setText(Double.toString(game.getBalance())); // update the balance
+ }//GEN-LAST:event_jButtonHitActionPerformed
+
+ private void jButtonExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonExitActionPerformed
+ // TODO: add exit operation
+ }//GEN-LAST:event_jButtonExitActionPerformed
+
+ /**
+ * @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
+ */
+ 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 ex) {
+ java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //</editor-fold>
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ new GUI().setVisible(true);
+ }
+ });
+ }
+
+ public void printDealerHand() {
+ jLabelDisplayDealerHand.setText(game.displayDealerHand());
+ jLabelDealerHandValue.setText(game.displayDealerHandValue());
+ }
+
+ public void printPlayerHand() {
+ jLabelDisplayPlayerHand.setText(game.displayPlayerHand());
+ jLabelPlayerHandValue.setText(game.displayPlayerHandValue());
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton jButtonBetAmount;
+ private javax.swing.JButton jButtonDeal;
+ private javax.swing.JButton jButtonDouble;
+ private javax.swing.JButton jButtonExit;
+ private javax.swing.JButton jButtonHit;
+ private javax.swing.JButton jButtonStand;
+ private javax.swing.JLabel jLabelBalance;
+ private javax.swing.JLabel jLabelCurrentBet;
+ private javax.swing.JLabel jLabelDealerHand;
+ private javax.swing.JLabel jLabelDealerHandValue;
+ private javax.swing.JLabel jLabelDisplayDealerHand;
+ private javax.swing.JLabel jLabelDisplayPlayerHand;
+ private javax.swing.JLabel jLabelPlayerHand;
+ private javax.swing.JLabel jLabelPlayerHandValue;
+ private javax.swing.JLabel jLabelResult;
+ private javax.swing.JPanel jPanel3;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/src/view/Main.java b/src/view/Main.java
@@ -10,6 +10,8 @@ public class Main {
public static void main(String[] args) {
System.out.println("Welcome to LIBREJACK!");
+
+ new TitleScreen().setVisible(true);
Controller librejack = new Controller();
librejack.startRound();
diff --git a/src/view/TitleScreen.form b/src/view/TitleScreen.form
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="3"/>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+ <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"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="400" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="300" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+</Form>
diff --git a/src/view/TitleScreen.java b/src/view/TitleScreen.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2022 michael
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package view;
+
+/**
+ *
+ * @author michael
+ */
+public class TitleScreen extends javax.swing.JFrame {
+
+ /**
+ * Creates new form TitleScreen
+ */
+ public TitleScreen() {
+ initComponents();
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 400, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 300, Short.MAX_VALUE)
+ );
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ /**
+ * @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
+ */
+ 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 ex) {
+ java.util.logging.Logger.getLogger(TitleScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(TitleScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(TitleScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(TitleScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //</editor-fold>
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ new TitleScreen().setVisible(true);
+ }
+ });
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ // End of variables declaration//GEN-END:variables
+}