Glow App
Zakira Sayed
Technical and Testing Document
4.1 Technical Document 1
4.1.1 Externally Sourced Code 1
4.1.2 Explanation of Critical Algorithms 1
4.1.3 Advanced Techniques 1
4.2 Testing Document 1
4.2.1 Evaluation of the Programmed Solution 1
4.2.2 Functional Testing 1
4.2.3 Test Plan and Results 1
5 Source Code 2
5.1 Class 1 2
5.2 Class 2 2
PAT TITLE Technical and Testing Document Your Name
4.1 Technical Document
4.1.1 Externally Sourced Code
This section of code allows for a random beauty tip to be displayed when the user presses the
“Generate” button.
private void btnTipActionPerformed([Link] evt) {
// TODO add your handling code here:
// Calls the random beautyTips method to display in the text area
Random rand = new Random();
int index = [Link]([Link]);
String selectedTip = beautyTips[index];
[Link]("Hi Gorgeous todays tip is " + [Link]());
[Link](selectedTip);
[Link]
4.1.2 Explanation of Critical Algorithms
1. Create Users Look by storing their details to the text file. The entire Application is based off of the
users details.
BEGIN
// Get user selections from combo boxes
hair ← value selected from Hair Color combo box
length ← value selected from Hair Length combo box
eye ← value selected from Eye Color combo box
skin ← value selected from Skin Color combo box
hairType ← value selected from Hair Type combo box
skinType ← value selected from Skin Type combo box
// Combine selected values into one line
PAT TITLE Technical and Testing Document Your Name Page 1
line ← hair + "," + length + "," + eye + "," + skin
// Try writing the line into a file
TRY
Open "[Link]" in append mode
Write line into file
Show message "Details saved successfully!"
CATCH error
Show message "Error writing file: " + error message
END TRY
// Reset all error labels to empty
clear error messages for eye, hair, length, skin, hair type, skin type
valid ← TRUE
// Validation checks
IF hairType = "Select" THEN
show "Enter hair type" in hair type error label
valid ← FALSE
END IF
IF skinType = "Select" THEN
show "Enter skin type" in skin type error label
valid ← FALSE
END IF
IF eye = "Select" THEN
show "Enter eye color" in eye color error label
valid ← FALSE
END IF
PAT TITLE Technical and Testing Document Your Name Page 2
IF hair = "Select" THEN
show "Enter hair color" in hair color error label
valid ← FALSE
END IF
IF length = "Select" THEN
show "Enter hair length" in hair length error label
valid ← FALSE
END IF
IF skin = "Select" THEN
show "Enter skin color" in skin color error label
valid ← FALSE
END IF
// Final confirmation
Show message "Done"
END
2. The Users routine is also an integral part of the application as it displays the routine the user
needs to follow based off their looks as well as products required.
METHOD getCareRoutine(hairColor, hairLength, skinColor, eyeColor, skinType, hairType)
RETURNS String
DECLARE routine AS String ← " Your Personalized Care Routine:\n\n"
DECLARE total AS Real ← 0
// Check Hair Color
SWITCH hairColor
CASE "black":
ADD "Haircare: Argan Oil Serum (once a week) – Nourishes and adds shine." TO routine
total ← total + 150
CASE "blonde":
ADD "Haircare: Purple Toning Shampoo (once a week) – Keeps brassiness away." TO
routine
total ← total + 120
CASE "brown":
PAT TITLE Technical and Testing Document Your Name Page 3
ADD "Haircare: Moisture Repair Hair Mask (once a week) – Enhances richness." TO
routine
total ← total + 180
CASE "ginger":
ADD "Haircare: Colour-Protect Conditioner (twice a week) – Maintains vibrancy." TO
routine
total ← total + 140
END SWITCH
// Check Hair Length
SWITCH hairLength
CASE "short":
ADD "Styling: Volumizing Styling Mousse (when styling) – Adds texture and volume." TO
routine
total ← total + 110
CASE "shoulder length":
ADD "Styling: Leave-In Conditioner Spray (when styling) – Detangles and protects." TO
routine
total ← total + 130
CASE "long":
ADD "Styling: Strengthening Hair Oil (3x a week) – Reduces breakage and adds shine."
TO routine
total ← total + 160
END SWITCH
// Check Skin Color
SWITCH skinColor
CASE "white":
ADD "Skincare: Hydrating Sunscreen SPF50 every day – Protects fair skin." TO routine
total ← total + 200
CASE "tan":
ADD "Skincare: Vitamin C Serum 3x a week – Brightens and evens tone." TO routine
total ← total + 250
CASE "brown":
ADD "Skincare: Shea Butter Moisturiser 1x a week – Locks in deep hydration." TO routine
total ← total + 180
CASE "lightskin":
ADD "Skincare: Niacinamide Cream 2x a week – Reduces blemishes and smooths skin."
TO routine
total ← total + 220
CASE "ebony":
ADD "Skincare: Rich Cocoa Butter Lotion daily – Enhances natural glow." TO routine
total ← total + 190
END SWITCH
// Check Skin Type
SWITCH skinType
CASE "clear":
ADD "Skincare: Gentle Foaming Cleanser (daily) – Keeps skin fresh without over-drying."
TO routine
total ← total + 100
CASE "combination":
PAT TITLE Technical and Testing Document Your Name Page 4
ADD "Skincare: Balancing Moisturizer (daily) – Hydrates dry areas and controls shine."
TO routine
total ← total + 130
CASE "acne prone":
ADD "Skincare: Salicylic Acid Treatment (3x per week) – Helps keep breakouts under
control." TO routine
total ← total + 160
DEFAULT:
ADD "Skincare: Skin type not recognized, love." TO routine
END SWITCH
// Check Hair Type
SWITCH hairType
CASE "straight":
ADD "Haircare: Shine-Enhancing Serum (twice a week) – Keeps strands sleek and
glossy." TO routine
total ← total + 140
CASE "wavy":
ADD "Haircare: Sea Salt Spray (2–3 times a week) – Defines waves and adds volume."
TO routine
total ← total + 110
CASE "curly":
ADD "Haircare: Curl-Defining Cream (every other day) – Hydrates and enhances curls."
TO routine
total ← total + 170
DEFAULT:
ADD "Haircare: Hair type not recognized, sweetheart." TO routine
END SWITCH
RETURN routine
END METHOD
4.1.3 Advanced Techniques
Reading from a JSON File. I read from a JSON File in the help section of the application.
public class HelpLoader {
public static String loadHelpText() {
try {
String content = new String([Link]([Link]("[Link]")));
JSONObject json = new JSONObject(content);
String helpText = [Link]("title") + "\n\n";
JSONArray sections = [Link]("sections");
PAT TITLE Technical and Testing Document Your Name Page 5
for (int i = 0; i < [Link](); i++) {
JSONObject section = [Link](i);
helpText += [Link]("topic") + ":\n";
helpText += [Link]("details") + "\n\n";
return helpText;
} catch (Exception e) {
return "Help file could not be loaded.";
4.2 Testing Document
4.2.1 Evaluation of the Programmed Solution
How does the end project compare with what you started? /
What did you change in the specifications?
The PAT is slightly different to what i had initially envisioned. Functions like the generate
random beauty tip was actually easier to create than expected. I am proud of how it turned out
and I think it has met sufficient needs that most users would require. I initially planned to create
a calander function but that idea was not developed due to me seeing no reason to have one,
Overall, i am very happy with the outcome.
o What goals did you meet?
I successfully made an application that does not provide general information or advice but
rather catered to a users specifications. The application provides a comprehensive experiences
and goexs as far to calculate a list of products a user might need to buy.
PAT TITLE Technical and Testing Document Your Name Page 6
What goals did you not meet?
Ai Integration would have developed this application even further however I did not manage to
do that, I also did not create the beauty calender which maybe could have scheduled the users
routine.
Comment on your time management.
My Time management for phase 3 was pretty good however during the influx of tests and
preliminary examinations i took a bit longer to complete the documentation.
What did you find challenging?
The Documentation is definitley the most challenging section of the PAT. It is a very long
process and very specific.
What improvements could you add that are not in the
original Specifications?
Perhaps the Glow App could have its own store in which users can pick and choose which
items they would like in their carts and thus buy directly from the application.
4.2.2 Functional Testing
.
Testers Name:
Christopher
Atanasov
Date:18/08/25 Date:
Program Functions: Gives user personal Works
recommendations off their physical characteristics. Correctly: Yes
Testers Name:
Nikita Yusuf
PAT TITLE Technical and Testing Document Your Name Page 7
Date: 18/08/25
Works
Correctly: Yes
Program Functions: Calculates luxurious and generic
products based from the users Routine.
4.2.3 Test Plan and Results
Check What needs to be Extreme data Invalid Data Valid Data
Type: present
Prescence The user needs to
check input their Physical
characteristics
5 Source Code
Add code for each class. Include ALL the code for GUIs. Use heading style fwHead2 for each
class.
PAT TITLE Technical and Testing Document Your Name Page 8
5.1 Class 1
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/** *
@author Sales
*/ public class BeautyClass {
String getUsername;
BeautyClass(String toString, String toString0, String toString1, String
toString2) {
throw new UnsupportedOperationException("Not supported yet."); //To
change body of generated methods, choose Tools | Templates.
}
BeautyClass(String name, String hairType, String skinTone) {
throw new UnsupportedOperationException("Not supported yet."); //To
change body of generated methods, choose Tools | Templates.
}
String getHairColor() {
throw new UnsupportedOperationException("Not supported yet."); //To
change body of generated methods, choose Tools | Templates.
}
String getHairLength() {
throw new UnsupportedOperationException("Not supported yet."); //To
change body of generated methods, choose Tools | Templates.
}
String getSkinColor() {
throw new UnsupportedOperationException("Not supported yet."); //To
change body of generated methods, choose Tools | Templates.
}
String getEyeColor() {
throw new UnsupportedOperationException("Not supported yet."); //To
change body of generated methods, choose Tools | Templates.
}
Object getUsername() {
throw new UnsupportedOperationException("Not supported yet."); //To
PAT TITLE Technical and Testing Document Your Name Page 9
change body of generated methods, choose Tools | Templates.
}
public class Beauty {
private String hairColor;
private String hairLength;
private String skinColor;
private String eyeColor;
private UserClass username;
private String CareRoutine;
private String hairType;
private String SkinType;
public Beauty(String hC, String hL, String sC, String eC, String cR,
String hT, String St) {
[Link] = hC;
[Link] = hL;
[Link] = sC;
[Link] = eC;
[Link] = username;
[Link] = cR;
[Link] = hT;
[Link] = St;
public String getCareRoutine() {
return CareRoutine;
}
public String getHairColor() {
return hairColor;
}
public String getHairLength() {
return hairLength;
}
public String getSkinColor() {
return skinColor;
}
public String getEyeColor() {
return eyeColor;
}
public UserClass getUsername() {
return username;
}
PAT TITLE Technical and Testing Document Your Name Page 10
public String getHairType() {
return hairType;
}
public String getSkinType() {
return SkinType;
}
public void setHairType(String hairType) {
[Link] = hairType;
}
public void setSkinType(String SkinType) {
[Link] = SkinType;
}
public void setUsername(UserClass username) {
[Link] = username;
}
public void setHairColor(String hairColor) {
[Link] = hairColor;
}
public void setHairLength(String hairLength) {
[Link] = hairLength;
}
public void setSkinColor(String skinColor) {
[Link] = skinColor;
}
public void setEyeColor(String eyeColor) {
[Link] = eyeColor;
}
public void setCareRoutine(String CareRoutine) {
[Link] = CareRoutine;
}
@Override
public String toString() {
return "Beauty Profile:\n"
+ "Hair Color: " + hairColor + "\n"
+ "Hair Length: " + hairLength + "\n"
+ "Skin Color: " + skinColor + "\n"
+ "Eye Color: " + eyeColor + "Username" + username + "\n"
+ "Routine" + CareRoutine + "Hair Type" + hairType + "\n"
+ "SkinType" + SkinType + "\n";
}
PAT TITLE Technical and Testing Document Your Name Page 11
}
5.2 Class 2
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/** *
@author Sales
*/ public class UserClass {
String getUsername() {
throw new UnsupportedOperationException("Not supported yet."); //
}
String getPassword() {
throw new UnsupportedOperationException("Not supported yet.");
}
public class User {
private String name;
private String surname;
private String username;
private String email;
private String password;
public User(String name, String surname, String username, String email,
String password) {
[Link] = name;
[Link] = surname;
[Link] = username;
[Link] = email;
[Link] = password;
}
PAT TITLE Technical and Testing Document Your Name Page 12
public String toFileString() {
return name + "," + surname + "," + username + "," + email + "," +
password;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
}
Source code
import [Link]; import [Link]; import [Link]; import
[Link]; import [Link]; import static [Link]; import
[Link]; import [Link];
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
/ /* *
@author Sales
*/ public class BeautyArray {
// Borrowed Code private BeautyClass[] beauties; private int count;
/**
*
* @param size
*/
public BeautyArray(int size) {
beauties = new BeautyClass[size];
count = 0;
}
/**
*
PAT TITLE Technical and Testing Document Your Name Page 13
*/
public BeautyArray(){
try {
Scanner scFile = new Scanner(new File("[Link]"));
String Line,hairColor,hairLength,skinColor,eyeColor,hairType,SkinType;
while ([Link]()) {
Line = [Link]();
Scanner sc = new Scanner(Line).useDelimiter("#");
hairColor = [Link]();
hairLength=[Link]();
skinColor=[Link]();
eyeColor=[Link]();
hairType= [Link]();
SkinType=[Link]();
beauties[count]= new BeautyClass(Line, hairType, SkinType);
count ++;
[Link]();
catch (FileNotFoundException e) {
[Link]("File Not Found");
}
/**
*
* @param beauty
*/
public void addBeauty(BeautyClass beauty) {
if (count < [Link]) {
beauties[count] = beauty;
count++;
} else {
[Link]("Array full, can't add more beauty 🥲");
}
}
/**
*
* @throws IOException
*/
PAT TITLE Technical and Testing Document Your Name Page 14
public void writeBeautiesToFile() throws IOException {
PrintWriter outFile = new PrintWriter(new FileWriter("[Link]"));
for (int i = 0; i < count; i++) {
[Link](
"Hair Color: " + beauties[i].getHairColor() + ", "
+ "Hair Length: " + beauties[i].getHairLength() + ", "
+ "Skin Color: " + beauties[i].getSkinColor() + ", "
+ "Eye Color: " + beauties[i].getEyeColor() + "\n" + "Skin Type"
);
}
[Link]();
}
/**
*
* @param hairColor
* @return // Recommends beauty tips for
* user based on hair Color return type String
*/
public String getRecommendationByHairColor(String hairColor) {
if (hairColor == null) {
return "Please select a hair color first, love.";
}
switch ([Link]()) {
case "black":
return "Go for bold lips "
"(like classic red) and silver or jewel-toned eyeshadow."; case "blonde": return "Soft pinks and
peaches make you glow." + " Try a coral lip and rose gold shimmer."; case "brown": return
"Earthy tones suit you best"
o " — bronze eyes, mocha lips, warm natural glow."; case "ginger": return "Emerald green
and plum tones make your hair pop. A nude lip balances the fire."; default: return "Hair
color not recognized. Try again, sweetheart.";
case "Dark Dye":
return "Go for bold lips (like classic red) and silver and ric light-toned eyeshadow.";
case "Light/neon Dye":
return "Use Bold and Contrasting Eye Shadow and a pink lip";
}
}
// Reccommends beauty tips for user based on Skin Color return type String
/**
PAT TITLE Technical and Testing Document Your Name Page 15
*
* @param skinColor
* @return
*/
public String getRecommendationBySkinColor(String skinColor) {
if (skinColor == null) {
return "Please select a skin color first, darling.";
}
switch ([Link]()) {
case "white":
return "Cool-toned blushes like pink or rose, paired with silver eyeshadow, give a porcelain goddess
glow."; case "tan": return "Warm bronzes and coral lips suit you perfectly. Embrace a golden highlight for
radiant beauty."; case "brown": return "Deep golds and warm reds flatter beautifully. Terracotta blush will
make your cheeks pop."; case "lightskin": return "Peachy tones and champagne shimmer look divine on
you, sweetheart. Try a soft gloss for lips."; case "ebony": return "Rich jewel tones like emerald and
amethyst are made for you. Glossy berry lips are breathtaking."; default: return "Hmm... not sure what to
suggest, love. Try selecting a listed skin color."; } }
// Reccommends beauty tips for user based on eye Color return type String
/**
*
* @param eyeColor
* @return
*/
public String getRecommendationByEyeColor(String eyeColor) {
if (eyeColor == null) {
return "Please select an eye color, sweetheart.";
}
switch ([Link]()) {
case "brown":
return "Rich tones like gold, bronze, and purple enhance your
warm depth. Try a deep eyeliner for drama.";
case "blue":
return "Copper, peach, and warm browns make your eyes sparkle.
Add mascara to make them unforgettable.";
case "green":
return "Plums and burgundy shades bring out the emerald in your
gaze. Soft shimmer on the inner corners is chef’s kiss.";
case "hazel":
return "You’re versatile, love — go for earthy tones like olive
and warm golds to shift those eye flecks.";
default:
return "Hmm, couldn’t read the stars in those eyes. Try a listed
option.";
}
}
PAT TITLE Technical and Testing Document Your Name Page 16
// Reccommends beauty tips for user based on hair length return type String
/**
*
* @param hairLength
* @return
*/
public String getRecommendationByHairLength(String hairLength) {
if (hairLength == null) {
return "Please choose a hair length, gorgeous.";
}
switch ([Link]()) {
case "short":
return "Short hair gives fierce energy. Accentuate with strong
brows, sharp liner, and bold earrings.";
case "shoulder length":
return "Soft waves and subtle glow suit you perfectly. Try a rose
highlight and a creamy nude lip.";
case "long":
return "Embrace the goddess vibe with flowing hair, fluttery
lashes, and a dreamy blush for full effect.";
default:
return "Not sure what style fits that length, love. Try picking
from the listed options.";
}
}
// Reccommends beauty tips for user based on Skin Type return type String
/**
*
* @param skinType
* @return
*/
public String getRecommendationBySkinType(String skinType) {
if (skinType == null) {
return "Please select a skin type first, love.";
}
switch ([Link]()) {
case "clear":
return "You have a lovely canvas, sweetheart! Go for natural and
glowing makeup to enhance your features.";
case "combination":
return "Balance is key, my angel. Use a mattifying foundation on
oily areas and hydrating products on dry patches.";
case "acne prone":
return "Keep it gentle and non-comedogenic, princess. Light
coverage and soothing ingredients will let your skin breathe.";
PAT TITLE Technical and Testing Document Your Name Page 17
default:
return "Skin type not recognized. Try again, love.";
}
}
// Reccommends beauty tips for user based on hair Type return type String
/**
*
* @param hairType
* @return
*/
public String getRecommendationByHairType(String hairType) {
if (hairType == null) {
return "Please select a hair type first, love.";
}
switch ([Link]()) {
case " 4c":
return "At night, use a silk bonnet or pillowcase to reduce
friction and frizz. ";
case "straight":
return "Sleek and smooth looks amazing on you, sweetheart. Try
shine-enhancing serums and straightening tools carefully.";
case "wavy":
return "Embrace your waves, my angel. Use light texturizing
sprays or mousse for soft, defined waves.";
case "curly":
return "Your curls are gorgeous, princess! Hydrating creams and
curl-defining gels will keep them bouncy and vibrant.";
default:
return "Hair type not recognized. Try again, love.";
}
// Writes users details to file return type void
/**
*
* @throws IOException
*/
public void AddBeautiesToFile() throws IOException {
PrintWriter outFile = new PrintWriter(new FileWriter("[Link]"));
for (int i = 0; i < count; i++) {
BeautyClass b = beauties[i];
[Link]("Username: " + [Link] + " | ");
[Link]("Hair Color: " + [Link]() + ", ");
[Link]("Hair Length: " + [Link]() + ", ");
[Link]("Skin Color: " + [Link]() + ", ");
[Link]("Eye Color: " + [Link]() + "\n");
PAT TITLE Technical and Testing Document Your Name Page 18
}
[Link]();
}
// Creates users Routine Return Type String
/**
*
* @param hairColor
* @param hairLength
* @param skinColor
* @param eyeColor
* @param Skintype
* @param hairType
* @return
*/
public String getCareRoutine(String hairColor, String hairLength, String
skinColor, String eyeColor,
String Skintype, String hairType) {
String routine = "✨ Your Personalized Care Routine:\n\n";
double total = 0;
// Hair Color
switch ([Link]()) {
case "black":
routine += "Haircare: Argan Oil Serum (once a week) – Nourishes
and adds shine.\n";
total += 150;
break;
case "blonde":
routine += "Haircare: Purple Toning Shampoo (once a week ) –
Keeps brassiness away.\n";
total += 120;
break;
case "brown":
routine += "Haircare: Moisture Repair Hair Mask (once a week) –
Enhances richness.\n";
total += 180;
break;
case "ginger":
routine += "Haircare: Colour-Protect Conditioner (twice a week) –
Maintains vibrancy.\n";
total += 140;
break;
}
// Hair Length
switch ([Link]()) {
case "short":
routine += "Styling: Volumizing Styling Mousse (when styling) –
Adds texture and volume.\n";
PAT TITLE Technical and Testing Document Your Name Page 19
total += 110;
break;
case "shoulder length":
routine += "Styling: Leave-In Conditioner Spray (when styling) –
Detangles and protects.\n";
total += 130;
break;
case "long":
routine += "Styling: Strengthening Hair Oil (3x a week) – Reduces
breakage and adds shine.\n";
total += 160;
break;
}
// Skin Color
switch ([Link]()) {
case "white":
routine += "Skincare: Hydrating Sunscreen SPF50 every day –
Protects fair skin.\n";
total += 200;
break;
case "tan":
routine += "Skincare: Vitamin C Serum 3x a week – Brightens and
evens tone.\n";
total += 250;
break;
case "brown":
routine += "Skincare: Shea Butter Moisturiser 1x a week – Locks
in deep hydration.\n";
total += 180;
break;
case "lightskin":
routine += "Skincare: Niacinamide Cream 2x a week – Reduces
blemishes and smooths skin.\n";
total += 220;
break;
case "ebony":
routine += "Skincare: Rich Cocoa Butter Lotion daily – Enhances
natural glow.\n";
total += 190;
break;
}
switch ([Link]()) {
case "clear":
routine += "Skincare: Gentle Foaming Cleanser (daily) – Keeps
skin fresh without over-drying.\n";
total += 100;
break;
case "combination":
routine += "Skincare: Balancing Moisturizer (daily) – Hydrates
PAT TITLE Technical and Testing Document Your Name Page 20
dry areas and controls shine.\n";
total += 130;
break;
case "acne prone":
routine += "Skincare: Salicylic Acid Treatment (3x per week) –
Helps keep breakouts under control.\n";
total += 160;
break;
default:
routine += "Skincare: Skin type not recognized, love.\n";
break;
}
switch ([Link]()) {
case "straight":
routine += "Haircare: Shine-Enhancing Serum (twice a week) –
Keeps strands sleek and glossy.\n";
total += 140;
break;
case "wavy":
routine += "Haircare: Sea Salt Spray (2–3 times a week) – Defines
waves and adds volume.\n";
total += 110;
break;
case "curly":
routine += "Haircare: Curl-Defining Cream (every other day) –
Hydrates and enhances curls.\n";
total += 170;
break;
default:
routine += "Haircare: Hair type not recognized, sweetheart.\n";
break;
}
return routine;
}
// Calculates generic beauty product prices for user return type double
/**
*
* @param hairColor
* @param hairLength
* @param skinColor
* @param eyeColor
* @param Skintype
* @param hairType
* @return
*/
public String getProductListAndTotal(String hairColor, String hairLength,
String skinColor, String eyeColor, String Skintype, String hairType) {
PAT TITLE Technical and Testing Document Your Name Page 21
String products = " Products you need:\n\n";
double total = 0;
// Hair Color
switch ([Link]()) {
case "black":
products += "- Argan Oil Serum: R150\n";
total += 150;
break;
case "blonde":
products += "- Purple Toning Shampoo: R120\n";
total += 120;
break;
case "brown":
products += "- Moisture Repair Hair Mask: R180\n";
total += 180;
break;
case "ginger":
products += "- Colour-Protect Conditioner: R140\n";
total += 140;
break;
case "Light/neon dye":
products += "color deposit treatmeant\n";
total += 190;
break;
}
// Hair Length
switch ([Link]()) {
case "short":
products += "- Volumizing Styling Mousse: R110\n";
total += 110;
break;
case "shoulder length":
products += "- Leave-In Conditioner Spray: R130\n";
total += 130;
break;
case "long":
products += "- Strengthening Hair Oil: R160\n";
total += 160;
break;
}
// Skin Color
switch ([Link]()) {
case "white":
products += "- Hydrating Sunscreen SPF50: R200\n";
total += 200;
break;
case "tan":
products += "- Vitamin C Serum: R250\n";
PAT TITLE Technical and Testing Document Your Name Page 22
total += 250;
break;
case "brown":
products += "- Shea Butter Moisturiser: R180\n";
total += 180;
break;
case "lightskin":
products += "- Niacinamide Cream: R220\n";
total += 220;
break;
case "ebony":
products += "- Rich Cocoa Butter Lotion: R190\n";
total += 190;
break;
}
switch ([Link]()) {
case "clear":
products += "- Gentle Foaming Cleanser: R100\n";
total += 100;
break;
case "combination":
products += "- Balancing Moisturizer: R130\n";
total += 130;
break;
case "acne prone":
products += "- Salicylic Acid Treatment: R160\n";
total += 160;
break;
default:
products += "- Skincare product not recognized\n";
break;
}
switch ([Link]()) {
case "straight":
products += "- Shine-Enhancing Serum: R140\n";
total += 140;
break;
case "wavy":
products += "- Sea Salt Spray: R110\n";
total += 110;
break;
case "curly":
products += "- Curl-Defining Cream: R170\n";
total += 170;
break;
default:
products += "- Haircare product not recognized\n";
break;
}
PAT TITLE Technical and Testing Document Your Name Page 23
products += "\n💰 Total Cost: R" + total;
return products;
}
/**
*
* @throws IOException
*/
public void writeDetail() throws IOException {
PrintWriter outFile = new PrintWriter(new FileWriter("[Link]"));
for (int i = 0; i < count; i++) {
[Link]("Hair Color: " + beauties[i].getHairColor() + ", "
+ "Hair Length: " + beauties[i].getHairLength() + ", "
+ "Skin Color: " + beauties[i].getSkinColor() + ", "
+ "Eye Color: " + beauties[i].getEyeColor() + "\n" +
"HairType" + beauties[i]);
[Link]();
}
}
// Calculates Lux products for user return type double
/**
*
* @param hairColor
* @param hairLength
* @param skinColor
* @param eyeColor
* @param hairType
* @param Skintype
* @return
*/
public String getluxproductAndTotal(String hairColor, String hairLength,
String skinColor, String eyeColor,
String hairType, String Skintype) {
String products = " lux Products (estimated value) :\n\n";
double total = 0;
// Hair Color
switch ([Link]()) {
case "black":
products += "-L'Oreal Argan Oil Serum: \n";
total += 250;
break;
case "blonde":
products += "- Oplex Purple Toning Shampoo: \n";
total += 200;
break;
case "brown":
products += "- Schwarzkopf Moisture Repair Hair Mask: \n";
PAT TITLE Technical and Testing Document Your Name Page 24
total += 200;
break;
case "ginger":
products += "-L'Oreal/ Colour-Protect Conditioner: \n";
total += 200;
break;
case "Light/neon dye":
products += "Micheal Kors color deposit treatmeant\n";
total += 290;
break;
}
// Hair Length
switch ([Link]()) {
case "short":
products += "- Chanel Volumizing Styling Mousse: \n";
total += 290;
break;
case "shoulder length":
products += "- Schwarzkopf Leave-In Conditioner Spray: \n";
total += 290;
break;
case "long":
products += "- L'Oreal Strengthening Hair Oil: \n";
total += 290;
break;
}
// Skin Color
switch ([Link]()) {
case "white":
products += "- Niviea Hydrating Sunscreen SPF50:\n";
total += 270;
break;
case "tan":
products += "- Garnier Vitamin C Serum: \n";
total += 250;
break;
case "brown":
products += "- Natures Gift Shea Butter Moisturiser: \n";
total += 280;
break;
case "lightskin":
products += "- The Ordinary Niacinamide Cream: \n";
total += 220;
break;
case "ebony":
products += "- Olaplex Rich Cocoa Butter Lotion: \n";
total += 290;
break;
}
PAT TITLE Technical and Testing Document Your Name Page 25
switch ([Link]()) {
case "straight":
products += "- Olaplex Shine-Enhancing Serum: \n";
total += 170;
break;
case "wavy":
products += "- Natures bliss Sea Salt Spray: \n";
total += 190;
break;
case "curly":
products += "- Chanel Curl-Defining Cream: \n";
total += 290;
break;
default:
products += "- Haircare product not recognized\n";
break;
}
switch ([Link]()) {
case "clear":
products += "- The Ordinary Gentle Foaming Cleanser: \n";
total += 190;
break;
case "combination":
products += "- L'Oreal Balancing Moisturizer: \n";
total += 190;
break;
case "acne prone":
products += "- Chanel Salicylic Acid Treatment: \n";
total += 280;
break;
default:
products += "- Skincare product not recognized\n";
break;
}
products += "\n💰 Total Cost: R" + total;
return products;
}
import [Link]; import [Link]; import [Link]; import
[Link];
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
PAT TITLE Technical and Testing Document Your Name Page 26
and open the template in the editor.
/ /* *
@author Sales
*/ public class HelpLoader {
public static String loadHelpText() {
try {
String content = new
String([Link]([Link]("[Link]")));
JSONObject json = new JSONObject(content);
String helpText = [Link]("title") + "\n\n";
JSONArray sections = [Link]("sections");
for (int i = 0; i < [Link](); i++) {
JSONObject section = [Link](i);
helpText += [Link]("topic") + ":\n";
helpText += [Link]("details") + "\n\n";
}
return helpText;
} catch (Exception e) {
return "Help file could not be loaded.";
}
}
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/ import [Link]; import [Link];
import [Link]; import [Link]; import [Link]; import
[Link]; import [Link]; import [Link]; import
[Link]; import [Link];
/** *
@author Sales
*/ public class Main extends [Link] {
// Array of Randomised beauty Tips
BeautyArray beautyarray = new BeautyArray(150);
String[] beautyTips = {
"Drink plenty of water every day 💧",
PAT TITLE Technical and Testing Document Your Name Page 27
"Always remove your makeup before bed 🛌",
"Exfoliate twice a week for glowing skin ✨",
"Use sunscreen every day—even indoors ☀️
",
"Clean your makeup brushes weekly ",
"Sleep at least 7-8 hours to avoid dull skin 😴",
"Massage your scalp with oil to boost hair growth ",
"Use silk pillowcases to reduce breakouts and frizz 💤",
"Keep your skincare simple and consistent 🧴",
"Never pop pimples—it causes scarring 😣",
"Hydrate your skin with a serum before moisturizer 💦",
"Do a face mask once a week ",
"Brush lips with a toothbrush for natural exfoliation 💋",
"Store eye cream in the fridge to reduce puffiness ❄️
",
"Use aloe vera gel to calm skin irritation 🌿",
"Try facial yoga to tone muscles ",
"Eat antioxidant-rich foods for healthy skin 🍓",
"Use a toner after cleansing to balance pH ⚖️",
"Don’t touch your face during the day 👐",
"Tie your hair loosely to prevent breakage ✨",
"Trim your ends every 6-8 weeks ✂️
",
"Moisturize damp skin for better absorption 🌊",
"Let your skin breathe by skipping makeup sometimes 💨",
"Use lip balm with SPF 💄",
"Change your pillowcase every few days 😴",
"Steam your face to open up pores ♨️",
"Rinse hair with cold water for shine ❄️
",
"Use a satin scrunchie to prevent split ends 🧵",
"Double cleanse if you wear makeup 🎭",
"Confidence is your best beauty product "
};
BeautyArray beautyArray = new BeautyArray(150);
BeautyClass currentBeauty;
/**
* Creates new form Main
*/
public Main() {
initComponents();
[Link](null);
/**
* 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")
PAT TITLE Technical and Testing Document Your Name Page 28
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
tabMain = new [Link]();
pnlTips = new [Link]();
lblTip = new [Link]();
jScrollPane2 = new [Link]();
txaviewTips = new [Link]();
btnTip = new [Link]();
pnlCreate = new [Link]();
lblAddHair = new [Link]();
cmbAddHair = new [Link]();
lblSkin = new [Link]();
cmbSkin = new [Link]();
jLabel1 = new [Link]();
cmbEye = new [Link]();
lblHairLength = new [Link]();
cmbHairLength = new [Link]();
btnDone = new [Link]();
lblHairColorError = new [Link]();
lblSkinColorError = new [Link]();
lblEyeColorError = new [Link]();
lblHairLengthError = new [Link]();
jLabel2 = new [Link]();
jLabel3 = new [Link]();
cmbHairType = new [Link]();
jLabel4 = new [Link]();
cmbSkintype = new [Link]();
lblHairTypeError = new [Link]();
lblSkintypeError = new [Link]();
pnlReccomend = new [Link]();
lblReccomend = new [Link]();
jScrollPane3 = new [Link]();
txaReccomend = new [Link]();
btnReccomendations = new [Link]();
pnlCart = new [Link]();
lblCart = new [Link]();
jScrollPane4 = new [Link]();
txaCart = new [Link]();
btnCalculate = new [Link]();
jScrollPane6 = new [Link]();
txaLux = new [Link]();
btnCalcLux = new [Link]();
jLabel5 = new [Link]();
jLabel6 = new [Link]();
pnlRoutine = new [Link]();
jScrollPane1 = new [Link]();
txaViewRoutine = new [Link]();
lblRoutine = new [Link]();
PAT TITLE Technical and Testing Document Your Name Page 29
lblRoutineError = new [Link]();
btnRoutine = new [Link]();
pnlhelp = new [Link]();
btnHelp = new [Link]();
jScrollPane5 = new [Link]();
txaHelp = new [Link]();
lblHelp = new [Link]();
setDefaultCloseOperation([Link].EXIT_ON_CLOSE);
[Link]([Link]);
[Link](new [Link](255, 153, 153));
[Link](new [Link]("Cambria Math", 1, 14)); // NOI18N
[Link](new [Link](255, 0, 51));
[Link]("Your Daily Beauty Tip, Diva");
[Link](new [Link](255, 102, 102));
[Link](20);
[Link](new [Link]("Microsoft YaHei Light", 0,
12)); // NOI18N
[Link](5);
[Link](new [Link](255, 255, 255));
[Link](txaviewTips);
[Link](new [Link]("Times New Roman", 0, 14)); // NOI18N
[Link]("Generate Tip");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnTipActionPerformed(evt);
}
});
[Link] pnlTipsLayout = new
[Link](pnlTips);
[Link](pnlTipsLayout);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGap(39, 39, 39)
.addComponent(btnTip)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup([Link]()
.addGap(23, 23, 23)
.addGroup([Link]([Link]
[Link])
.addComponent(jScrollPane2,
[Link].PREFERRED_SIZE, 426,
[Link].PREFERRED_SIZE)
PAT TITLE Technical and Testing Document Your Name Page 30
.addComponent(lblTip, [Link].PREFERRED_SIZE,
321, [Link].PREFERRED_SIZE))
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGap(19, 19, 19)
.addComponent(lblTip, [Link].DEFAULT_SIZE,
[Link].DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(btnTip)
.addGap(28, 28, 28)
.addComponent(jScrollPane2,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addGap(93, 93, 93))
);
[Link]("Daily Beauty Tip", pnlTips);
[Link](new [Link](255, 102, 102));
[Link](new [Link]("Yu Gothic", 0, 12)); // NOI18N
[Link]("Add Your Hair Color");
[Link](new [Link]("Yu Gothic", 0, 14)); // NOI18N
[Link](new [Link](255, 51, 102));
[Link](new [Link](new String[]
{ "Select ", "Black", "Blonde", "Brown", "Ginger", "Dark Dye", "Neon
Dye" }));
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
cmbAddHairActionPerformed(evt);
}
});
[Link]("Choose Your skin color");
[Link](new [Link]("Yu Gothic", 0, 14)); // NOI18N
[Link](new [Link](51, 0, 204));
[Link](new [Link](new String[]
{ "Select", "White", "tan", "Brown", "Light Skin", "Ebony" }));
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
cmbSkinActionPerformed(evt);
}
});
PAT TITLE Technical and Testing Document Your Name Page 31
[Link]("Add Your Eye Color");
[Link](new [Link]("Yu Gothic", 0, 14)); // NOI18N
[Link](new [Link](255, 102, 204));
[Link](new [Link](new String[]
{ "Select", "Blue", "Brown", "Green", "Hazel" }));
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
cmbEyeActionPerformed(evt);
}
});
[Link]("Add your hair Length");
[Link](new [Link](new String[]
{ "Select", "Short", "Shoulder Length", "Long" }));
[Link]("Done");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnDoneActionPerformed(evt);
}
});
[Link](new [Link](204, 0, 0));
[Link]("Add Hair Color");
[Link](new [Link](204, 0, 0));
[Link]("Add Skin Color");
[Link](new [Link](255, 0, 0));
[Link]("Add Eye Color");
[Link](new [Link](255, 0, 0));
[Link]("Add Hair Length");
[Link](new [Link]("Times New Roman", 0, 14)); // NOI18N
[Link]("Add in your Deets, Pretty Princess");
[Link]("Add your Hair Type");
[Link](new [Link](new String[]
{ "Select", "Straight", "Wavy", "Curly", "4C" }));
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
cmbHairTypeActionPerformed(evt);
}
});
[Link]("Add your Skin Type");
PAT TITLE Technical and Testing Document Your Name Page 32
[Link](new [Link](new String[]
{ "Select", "Clear", "combination", "Acne Prone" }));
[Link](" ");
[Link](" .");
[Link] pnlCreateLayout = new
[Link](pnlCreate);
[Link](pnlCreateLayout);
[Link](
[Link]([Link]
)
.addGroup([Link]()
.addContainerGap()
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addComponent(lblSkin)
.addPreferredGap([Link]
[Link], [Link].DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup([Link]([Link]
.[Link])
.addComponent(lblSkinColorError)
.addComponent(lblHairColorError)
.addComponent(lblEyeColorError)
.addComponent(lblHairLengthError)))
.addGroup([Link]()
.addGroup([Link]([Link]
.[Link])
.addGroup([Link]()
.addComponent(lblAddHair)
.addGap(58, 58, 58)
.addGroup([Link](jav
[Link])
.addComponent(cmbEye,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addComponent(cmbAddHair,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addComponent(cmbSkin,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)))
.addGroup([Link](javax.s
[Link])
.addComponent(cmbHairType,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addComponent(cmbHairLength,
PAT TITLE Technical and Testing Document Your Name Page 33
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addComponent(cmbSkintype,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)))
.addGroup([Link]([Link]
.[Link])
.addGroup([Link]()
.addGap(36, 36, 36)
.addComponent(lblHairTypeError,
[Link].PREFERRED_SIZE, 82,
[Link].PREFERRED_SIZE))
.addGroup([Link]()
.addGap(56, 56, 56)
.addComponent(lblSkintypeError,
[Link].PREFERRED_SIZE, 92,
[Link].PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(77, 77, 77))
.addGroup([Link]()
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(205, 205, 205)
.addComponent(btnDone))
.addGroup([Link]()
.addGap(90, 90, 90)
.addComponent(jLabel2,
[Link].PREFERRED_SIZE, 229,
[Link].PREFERRED_SIZE))
.addGroup([Link]()
.addContainerGap()
.addComponent(jLabel1))
.addGroup([Link]()
.addContainerGap()
.addComponent(lblHairLength))
.addGroup([Link]()
.addContainerGap()
.addComponent(jLabel3))
.addGroup([Link]()
.addContainerGap()
.addComponent(jLabel4)))
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link](
[Link]([Link]
)
.addGroup([Link]()
.addContainerGap()
PAT TITLE Technical and Testing Document Your Name Page 34
.addComponent(jLabel2)
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(4, 4, 4)
.addComponent(lblHairColorError)
.addGap(18, 18, 18)
.addGroup([Link]([Link]
.[Link])
.addComponent(lblSkin,
[Link].PREFERRED_SIZE, 14,
[Link].PREFERRED_SIZE)
.addGroup([Link]()
.addGap(35, 35, 35)
.addComponent(lblSkinColorError))))
.addGroup([Link]()
.addGap(24, 24, 24)
.addComponent(cmbSkin,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup([Link]([Link]
.[Link])
.addComponent(lblAddHair)
.addComponent(cmbAddHair,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))))
.addGap(28, 28, 28)
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addComponent(jLabel1)
.addGap(1, 1, 1)
.addComponent(lblEyeColorError))
.addComponent(cmbEye, [Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGap(17, 17, 17)
.addGroup([Link]([Link]
[Link])
.addComponent(lblHairLength)
.addComponent(cmbHairLength,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGap(3, 3, 3)
.addComponent(lblHairLengthError)
.addGap(8, 8, 8)
.addGroup([Link]([Link]
[Link])
.addComponent(jLabel3)
.addComponent(cmbHairType,
PAT TITLE Technical and Testing Document Your Name Page 35
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addComponent(lblHairTypeError))
.addPreferredGap([Link]
ATED)
.addGroup([Link]([Link]
[Link])
.addComponent(jLabel4)
.addComponent(cmbSkintype,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addComponent(lblSkintypeError))
.addPreferredGap([Link]
ED, [Link].DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnDone)
.addGap(20, 20, 20))
);
[Link]("Create your look", pnlCreate);
[Link](new [Link](255, 51, 51));
[Link](new [Link](255, 51, 51));
[Link](new [Link]("Times New Roman", 0, 14)); //
NOI18N
[Link]("Some Reccomendations based off your look");
[Link](new [Link](255, 153, 153));
[Link](20);
[Link](new [Link]("Calibri", 0, 14)); // NOI18N
[Link](5);
[Link](txaReccomend);
[Link](new [Link]("Times New Roman", 0,
18)); // NOI18N
[Link]("Show Suggestions");
[Link](new [Link]()
{
public void actionPerformed([Link] evt) {
btnReccomendationsActionPerformed(evt);
}
});
[Link] pnlReccomendLayout = new
[Link](pnlReccomend);
[Link](pnlReccomendLayout);
[Link](
[Link]([Link]
ING)
.addGroup([Link],
PAT TITLE Technical and Testing Document Your Name Page 36
[Link]()
.addContainerGap()
.addComponent(jScrollPane3))
.addGroup([Link]()
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(65, 65, 65)
.addComponent(lblReccomend))
.addGroup([Link]()
.addGap(176, 176, 176)
.addComponent(btnReccomendations)))
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link](
[Link]([Link]
ING)
.addGroup([Link]()
.addGap(19, 19, 19)
.addComponent(lblReccomend)
.addPreferredGap([Link]
ED)
.addComponent(jScrollPane3)
.addPreferredGap([Link]
ED)
.addComponent(btnReccomendations)
.addContainerGap())
);
[Link]("Personal Reccomendations", pnlReccomend);
[Link](new [Link](255, 51, 51));
[Link](new [Link](255, 102, 102));
[Link](new [Link]("Times New Roman", 0, 14)); // NOI18N
[Link]("Hey Girl! You needa get Shopping (Estimated values)");
[Link](20);
[Link](5);
[Link](txaCart);
[Link]("Calculate");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnCalculateActionPerformed(evt);
}
});
[Link](20);
PAT TITLE Technical and Testing Document Your Name Page 37
[Link](5);
[Link](txaLux);
[Link]("Calculate");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnCalcLuxActionPerformed(evt);
}
});
[Link]("Generic Items");
[Link]("Luxury Items");
[Link] pnlCartLayout = new
[Link](pnlCart);
[Link](pnlCartLayout);
[Link](
[Link]([Link])
.addGroup([Link],
[Link]()
.addGap(55, 55, 55)
.addComponent(btnCalculate)
.addPreferredGap([Link]
ED, [Link].DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnCalcLux)
.addGap(175, 175, 175))
.addGroup([Link]()
.addContainerGap()
.addComponent(jScrollPane4,
[Link].PREFERRED_SIZE, 210,
[Link].PREFERRED_SIZE)
.addPreferredGap([Link]
ED, 72, Short.MAX_VALUE)
.addComponent(jScrollPane6,
[Link].PREFERRED_SIZE, 201,
[Link].PREFERRED_SIZE)
.addGap(118, 118, 118))
.addGroup([Link]()
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(39, 39, 39)
.addComponent(lblCart,
[Link].PREFERRED_SIZE, 321,
[Link].PREFERRED_SIZE))
.addGroup([Link]()
.addGap(91, 91, 91)
.addComponent(jLabel5)
.addGap(201, 201, 201)
PAT TITLE Technical and Testing Document Your Name Page 38
.addComponent(jLabel6)))
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link](
[Link]([Link])
.addGroup([Link]()
.addContainerGap()
.addComponent(lblCart, [Link].PREFERRED_SIZE,
42, [Link].PREFERRED_SIZE)
.addPreferredGap([Link]
ED, 11, Short.MAX_VALUE)
.addGroup([Link]([Link]
[Link])
.addComponent(jLabel5)
.addComponent(jLabel6))
.addPreferredGap([Link]
ATED)
.addGroup([Link]([Link]
[Link], false)
.addComponent(jScrollPane4,
[Link].DEFAULT_SIZE, 157, Short.MAX_VALUE)
.addComponent(jScrollPane6))
.addGap(17, 17, 17)
.addGroup([Link]([Link]
[Link])
.addComponent(btnCalcLux)
.addComponent(btnCalculate))
.addGap(73, 73, 73))
);
[Link]("Your Cart", pnlCart);
[Link](new [Link](255, 102, 102));
[Link](20);
[Link](5);
[Link](txaViewRoutine);
[Link](new [Link]("Times New Roman", 0, 14)); //
NOI18N
[Link]("Your Routine for today, Sugar Plum");
[Link]("Show Routine");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnRoutineActionPerformed(evt);
}
});
PAT TITLE Technical and Testing Document Your Name Page 39
[Link] pnlRoutineLayout = new
[Link](pnlRoutine);
[Link](pnlRoutineLayout);
[Link](
[Link]([Link]
G)
.addGroup([Link]()
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addContainerGap()
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(10, 10, 10)
.addComponent(lblRoutineError))
.addComponent(jScrollPane1,
[Link].PREFERRED_SIZE, 458,
[Link].PREFERRED_SIZE)))
.addGroup([Link]()
.addGap(190, 190, 190)
.addComponent(btnRoutine))
.addGroup([Link]()
.addGap(19, 19, 19)
.addComponent(lblRoutine)))
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link](
[Link]([Link]
G)
.addGroup([Link]()
.addContainerGap()
.addComponent(lblRoutine)
.addGap(38, 38, 38)
.addComponent(jScrollPane1,
PAT TITLE Technical and Testing Document Your Name Page 40
[Link].PREFERRED_SIZE, 173,
[Link].PREFERRED_SIZE)
.addPreferredGap([Link]
ATED)
.addComponent(lblRoutineError)
.addPreferredGap([Link]
ED)
.addComponent(btnRoutine)
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link]("Todays Routine", pnlRoutine);
[Link](new [Link](255, 51, 51));
[Link](new [Link](255, 51, 51));
[Link]("Press for help");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnHelpActionPerformed(evt);
}
});
[Link](new [Link](255, 102, 102));
[Link](20);
[Link](5);
[Link](txaHelp);
[Link](new [Link]("Times New Roman", 0, 18)); // NOI18N
[Link]("Need Some Help?");
[Link] pnlhelpLayout = new
[Link](pnlhelp);
[Link](pnlhelpLayout);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(181, 181, 181)
.addComponent(btnHelp,
[Link].PREFERRED_SIZE, 122,
[Link].PREFERRED_SIZE))
.addGroup([Link]()
.addGap(150, 150, 150)
.addComponent(lblHelp,
[Link].PREFERRED_SIZE, 178,
[Link].PREFERRED_SIZE))
PAT TITLE Technical and Testing Document Your Name Page 41
.addGroup([Link]()
.addContainerGap()
.addComponent(jScrollPane5,
[Link].PREFERRED_SIZE, 528,
[Link].PREFERRED_SIZE)))
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link](
[Link]([Link])
.addGroup([Link]()
.addContainerGap()
.addComponent(lblHelp, [Link].PREFERRED_SIZE,
31, [Link].PREFERRED_SIZE)
.addPreferredGap([Link]
ATED)
.addComponent(jScrollPane5,
[Link].PREFERRED_SIZE, 196,
[Link].PREFERRED_SIZE)
.addPreferredGap([Link]
ED)
.addComponent(btnHelp)
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link]("Help", pnlhelp);
[Link] layout = new
[Link](getContentPane());
getContentPane().setLayout(layout);
[Link](
[Link]([Link])
.addComponent(tabMain)
);
[Link](
[Link]([Link])
.addComponent(tabMain)
);
pack();
}// </editor-fold>
private void btnDoneActionPerformed([Link] evt) {
// TODO add your handling code here:
// stores the users details into the text file String hair = [Link]().toString(); String
length = [Link]().toString(); String eye = [Link]().toString();
PAT TITLE Technical and Testing Document Your Name Page 42
String skin = [Link]().toString(); String hairType =
[Link]().toString(); String skinType = [Link]().toString();
String line = hair + "," + length + "," + eye + "," + skin;
try (FileWriter fw = new FileWriter("[Link]", true);
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter out = new PrintWriter(bw)) {
[Link](line); // write the line into the file
[Link](this, "Details saved successfully!");
} catch (IOException e) {
[Link](this, "Error writing file: " +
[Link]());
}
[Link]("");
[Link]("");
[Link]("");
[Link]("");
[Link]("");
[Link]("");
boolean valid = true;
String HairType = [Link]().toString();
try {
if ([Link]("Select")) {
[Link]("Enter hair type");
valid = false;
}
} catch (Exception e) {
}
String SkinType = [Link]().toString();
try {
if ([Link]("Select")) {
[Link]("Enter Skin Type");
valid = false;
}
} catch (Exception e) {
}
String EyeColor = [Link]().toString();
try {
if ([Link]("Select")) {
[Link]("Enter Eye color");
valid = false;
}
} catch (Exception e) {
PAT TITLE Technical and Testing Document Your Name Page 43
}
String HairColor = [Link]().toString();
try {
if ([Link]("Select")) {
[Link]("Enter Hair Color");
valid = false;
}
} catch (Exception e) {
}
String HairLength = [Link]().toString();
try {
if ([Link]("Select")) {
[Link]("Enter Hair Lenghth");
valid = false;
}
} catch (Exception e) {
}
String SkinColor = [Link]().toString();
try {
if ([Link]("Select")) {
[Link]("Enter skin color");
valid = false;
}
} catch (Exception e) {
}
[Link](this, "Done");
private void cmbEyeActionPerformed([Link] evt) {
// TODO add your handling code here:
}
private void cmbSkinActionPerformed([Link] evt) {
// TODO add your handling code here:
}
private void cmbAddHairActionPerformed([Link] evt) {
// TODO add your handling code here:
}
private void btnReccomendationsActionPerformed([Link]
evt) {
PAT TITLE Technical and Testing Document Your Name Page 44
// TODO add your handling code here:
// Calls the getRecommendations method to display in the text area String hair =
[Link]().toString(); String length = [Link]().toString();
String eye = [Link]().toString(); String skin = [Link]().toString();
String line = hair + "," + length + "," + eye + "," + skin;
try (FileWriter fw = new FileWriter("[Link]", true);
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter out = new PrintWriter(bw)) {
[Link](line); // write the line into the file
[Link](this, "Details saved successfully!");
} catch (IOException e) {
[Link](this, "Error writing file: " +
[Link]());
}
String hairLength = [Link]().toString();
[Link]("Selected" + hairLength);
String lengthRec = [Link](hairLength);
String hairColor = [Link]().toString();
[Link]("Selected: " + hairColor);
String recommendation =
[Link](hairColor);
[Link]("According to your hair " + "\t" + recommendation);
String skinColor = [Link]().toString();
[Link]("Selected:" + skinColor);
String skinRec = [Link](skinColor);
[Link]("According to your skinTone" + "\n" + skinRec
+ "According to your hair " + "\n" + recommendation
+ "According to your EyeColor" + "\n" + "According to Hair
Length"
+ "\n" + lengthRec);
String eyeColor = [Link]().toString();
[Link]("Selected" + eyeColor);
String eyeStyle = [Link](eyeColor);
String fullRec = "✨ Your Personal Glow-Up Report:\n\n"
+ " Hair Color: " + hairColor + "\n" + recommendation + "\n\n"
+ "📏 Hair Length: " + hairLength + "\n" + lengthRec + "\n\n"
+ "🌸 Skin Tone: " + skinColor + "\n" + skinRec + "\n\n"
+ " Eye Color: " + eyeColor + "\n" + eyeStyle;
[Link](fullRec + "\n" + "Press Button again to
PAT TITLE Technical and Testing Document Your Name Page 45
Refresh \"");
private void btnTipActionPerformed([Link] evt) {
// TODO add your handling code here:
// Calls the random beautyTips method to display in the text area Random rand = new Random(); int
index = [Link]([Link]); String selectedTip = beautyTips[index]; [Link]("Hi
Gorgeous todays tip is " + [Link]()); [Link](selectedTip);
private void btnRoutineActionPerformed([Link] evt) {
// TODO add your handling code here:
// Calls the getCareRoutine method to display in the text area
if ([Link]() == "Select"
|| [Link]() == "Select"
|| [Link]() == "Select"
|| [Link]() == "Select"
|| [Link]() == "Select"
|| [Link]() == "Select") {
[Link](this,
"Please select hair color, hair length, hair type,"
+ " skin type, skin tone, and eye color first.",
"Selection Required",
JOptionPane.WARNING_MESSAGE);
return;
}
String hairColor = [Link]().toString();
String hairLength = [Link]().toString();
String skinColor = [Link]().toString();
String eyeColor = [Link]().toString();
String hairType = [Link]().toString();
String Skintype = [Link]().toString();
String routine = [Link](hairColor, hairLength,
skinColor, eyeColor, Skintype, hairType);
[Link](routine + "Press Button again to Refresh ");
private void btnCalculateActionPerformed([Link] evt) {
PAT TITLE Technical and Testing Document Your Name Page 46
// TODO add your handling code here:
// Calls the getProductsAndTotal method to display in the text area if ([Link]() ==
null || [Link]() == null || [Link]() == null ||
[Link]() == null || [Link]() == null ||
[Link]() == null) {
[Link](this,
"Please select hair color, hair length, skin tone, dkin type,
hair type and eye color first.",
"Selection Required",
JOptionPane.WARNING_MESSAGE);
return;
}
String hairColor = [Link]().toString();
String hairLength = [Link]().toString();
String skinColor = [Link]().toString();
String eyeColor = [Link]().toString();
String hairType = [Link]().toString();
String skinType = [Link]().toString();
String productList = [Link](hairColor,
hairLength, skinColor, eyeColor, skinType, hairType);
[Link](productList + "Press Button again to Refresh ");
private void btnHelpActionPerformed([Link] evt) {
// TODO add your handling code here:
String helpText = [Link]();
[Link](helpText);
}
private void btnCalcLuxActionPerformed([Link] evt) {
// TODO add your handling code here:
// Calls the getLuxProductsAndTotal method to display in the text area
if ([Link]() == null
|| [Link]() == null
|| [Link]() == null
|| [Link]() == null) {
[Link](this,
"Please select hair color, hair length, skin tone, and eye
color first.",
"Selection Required",
PAT TITLE Technical and Testing Document Your Name Page 47
JOptionPane.WARNING_MESSAGE);
return;
}
{
String hairColor = [Link]().toString();
String hairLength = [Link]().toString();
String skinColor = [Link]().toString();
String eyeColor = [Link]().toString();
String hairType = [Link]().toString();
String Skintype = [Link]().toString();
String productList = [Link](hairColor,
hairLength, skinColor, eyeColor, Skintype, hairType);
[Link](productList + "\n" + "Press button to refresh");
}
}
private void cmbHairTypeActionPerformed([Link] evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
try {
for ([Link] info :
[Link]()) {
if ("Nimbus".equals([Link]())) {
[Link]([Link]());
break;
}
}
} catch (ClassNotFoundException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
} catch (InstantiationException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
} catch (IllegalAccessException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
} catch ([Link] ex) {
[Link]([Link]()).log([Link]
PAT TITLE Technical and Testing Document Your Name Page 48
[Link], null, ex);
}
//</editor-fold>
/* Create and display the form */
[Link](new Runnable() {
public void run() {
new Main().setVisible(true);
}
});
}
// Variables declaration - do not modify
private [Link] btnCalcLux;
private [Link] btnCalculate;
private [Link] btnDone;
private [Link] btnHelp;
private [Link] btnReccomendations;
private [Link] btnRoutine;
private [Link] btnTip;
public [Link] cmbAddHair;
private [Link] cmbEye;
private [Link] cmbHairLength;
private [Link] cmbHairType;
private [Link] cmbSkin;
private [Link] cmbSkintype;
private [Link] jLabel1;
private [Link] jLabel2;
private [Link] jLabel3;
private [Link] jLabel4;
private [Link] jLabel5;
private [Link] jLabel6;
private [Link] jScrollPane1;
private [Link] jScrollPane2;
private [Link] jScrollPane3;
private [Link] jScrollPane4;
private [Link] jScrollPane5;
private [Link] jScrollPane6;
private [Link] lblAddHair;
private [Link] lblCart;
PAT TITLE Technical and Testing Document Your Name Page 49
private [Link] lblEyeColorError;
private [Link] lblHairColorError;
private [Link] lblHairLength;
private [Link] lblHairLengthError;
private [Link] lblHairTypeError;
private [Link] lblHelp;
private [Link] lblReccomend;
private [Link] lblRoutine;
private [Link] lblRoutineError;
private [Link] lblSkin;
private [Link] lblSkinColorError;
private [Link] lblSkintypeError;
private [Link] lblTip;
private [Link] pnlCart;
private [Link] pnlCreate;
private [Link] pnlReccomend;
private [Link] pnlRoutine;
private [Link] pnlTips;
private [Link] pnlhelp;
private [Link] tabMain;
private [Link] txaCart;
private [Link] txaHelp;
private [Link] txaLux;
private [Link] txaReccomend;
private [Link] txaViewRoutine;
private [Link] txaviewTips;
// End of variables declaration
import [Link]; import [Link]; import [Link]; import
[Link]; import [Link];
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
/ /* *
@author Sales
*/ public class SignUp extends [Link] {
/**
* Creates new form SignUp
*/
{
PAT TITLE Technical and Testing Document Your Name Page 50
public SignUp() {
initComponents();
[Link](null);
/**
* 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">
private void initComponents() {
jScrollPane1 = new [Link]();
jTextArea1 = new [Link]();
jButton2 = new [Link]();
lblSignup = new [Link]();
lblName = new [Link]();
lblSurname = new [Link]();
lblUser = new [Link]();
lblPassword = new [Link]();
lblEmail = new [Link]();
pwfPassword = new [Link]();
txfName = new [Link]();
txfSurname = new [Link]();
txfEmail = new [Link]();
txfUsername = new [Link]();
btnSignUp = new [Link]();
lblNameError = new [Link]();
lblSurnameError = new [Link]();
LblEmailError = new [Link]();
lblUserError = new [Link]();
lblPasswordError = new [Link]();
btnlog = new [Link]();
jLabel1 = new [Link]();
[Link](20);
[Link](5);
[Link](jTextArea1);
[Link]("jButton2");
setDefaultCloseOperation([Link].EXIT_ON_CLOSE);
setAutoRequestFocus(false);
setBackground(new [Link](255, 0, 51));
setFont(new [Link]("Calibri", 1, 12)); // NOI18N
setForeground(new [Link](255, 51, 51));
PAT TITLE Technical and Testing Document Your Name Page 51
[Link]("Sign up please");
[Link]("Enter your Name ");
[Link]("Enter your Surname");
[Link]("Create UserName");
[Link]("Create Password");
[Link]("Ente your Email address");
[Link]("jPasswordField1");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
pwfPasswordActionPerformed(evt);
}
});
[Link](" ");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
txfNameActionPerformed(evt);
}
});
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
txfSurnameActionPerformed(evt);
}
});
[Link](" ");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
txfEmailActionPerformed(evt);
}
});
[Link](" ");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
txfUsernameActionPerformed(evt);
}
});
[Link]("SignUp");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnSignUpActionPerformed(evt);
PAT TITLE Technical and Testing Document Your Name Page 52
}
});
[Link](" ");
[Link](" ");
[Link]("Log in");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnlogActionPerformed(evt);
}
});
[Link]("Already Have an Account?");
[Link] layout = new
[Link](getContentPane());
getContentPane().setLayout(layout);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGap(164, 164, 164)
.addComponent(lblSignup))
.addGroup([Link]()
.addGap(31, 31, 31)
.addComponent(lblName)
.addGap(59, 59, 59)
.addComponent(txfName, [Link].PREFERRED_SIZE,
69, [Link].PREFERRED_SIZE))
.addGroup([Link]()
.addGap(31, 31, 31)
.addComponent(lblSurname)
.addGap(47, 47, 47)
.addComponent(txfSurname, [Link].PREFERRED_SIZE,
69, [Link].PREFERRED_SIZE))
.addGroup([Link]()
.addGap(10, 10, 10)
.addComponent(lblEmail)
.addGap(43, 43, 43)
.addComponent(txfEmail, [Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGroup([Link]()
.addGap(10, 10, 10)
.addComponent(lblUser)
.addGap(73, 73, 73)
.addComponent(txfUsername,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addGap(10, 10, 10)
PAT TITLE Technical and Testing Document Your Name Page 53
.addComponent(lblUserError))
.addGroup([Link]()
.addGap(10, 10, 10)
.addGroup([Link]([Link]
[Link])
.addComponent(lblPassword)
.addGroup([Link]()
.addGap(50, 50, 50)
.addComponent(btnSignUp)))
.addGap(43, 43, 43)
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addComponent(pwfPassword,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(lblPasswordError))
.addGroup([Link]()
.addGap(92, 92, 92)
.addComponent(jLabel1))
.addGroup([Link]()
.addGap(129, 129, 129)
.addComponent(btnlog))))
);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGap(34, 34, 34)
.addComponent(lblSignup)
.addGap(15, 15, 15)
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(2, 2, 2)
.addComponent(lblName,
[Link].PREFERRED_SIZE, 17,
[Link].PREFERRED_SIZE))
.addComponent(txfName,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(3, 3, 3)
.addComponent(lblSurname))
.addComponent(txfSurname,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGap(18, 18, 18)
PAT TITLE Technical and Testing Document Your Name Page 54
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(3, 3, 3)
.addComponent(lblEmail))
.addComponent(txfEmail,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGap(17, 17, 17)
.addGroup([Link]([Link]
[Link])
.addComponent(txfUsername,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addGroup([Link]()
.addGap(3, 3, 3)
.addGroup([Link]([Link]
[Link])
.addComponent(lblUser)
.addComponent(lblUserError))))
.addGap(18, 18, 18)
.addGroup([Link]([Link]
[Link])
.addGroup([Link]()
.addGap(3, 3, 3)
.addComponent(lblPassword)
.addGap(21, 21, 21)
.addComponent(btnSignUp))
.addGroup([Link]()
.addGroup([Link]([Link]
[Link])
.addComponent(pwfPassword,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addGroup([Link]()
.addGap(3, 3, 3)
.addComponent(lblPasswordError))
.addGroup([Link]()
.addGap(16, 16, 16)
.addComponent(jLabel1,
[Link].PREFERRED_SIZE, 27,
[Link].PREFERRED_SIZE)))
.addGap(9, 9, 9)
.addComponent(btnlog))))
);
setSize(new [Link](416, 339));
setLocationRelativeTo(null);
}// </editor-fold>
private void txfEmailActionPerformed([Link] evt) {
PAT TITLE Technical and Testing Document Your Name Page 55
// TODO add your handling code here:
}
private void txfNameActionPerformed([Link] evt) {
// TODO add your handling code here:
}
private void txfSurnameActionPerformed([Link] evt) {
// TODO add your handling code here:
}
private void pwfPasswordActionPerformed([Link] evt) {
// TODO add your handling code here:
}
private void txfUsernameActionPerformed([Link] evt) {
// TODO add your handling code here:
}
private void btnSignUpActionPerformed([Link] evt) {
[Link]("");
[Link]("");
[Link]("");
[Link]("");
[Link]("");
boolean valid = true;
String email = [Link]();
try {
if () {
[Link]("Email Invalid");
valid = false;
}
} catch (Exception e) {
}
String Name = [Link]();
try {
if ([Link]() < 2) {
[Link]("Enter your name");
valid = false;
}
PAT TITLE Technical and Testing Document Your Name Page 56
} catch (Exception e) {
}
String Surname = [Link]();
try {
if ([Link]() < 2) {
[Link]("Enter your suname");
}
} catch (Exception e) {
}
String User = [Link]();
try {
if ([Link]() < 2) {
[Link]("Enter a username");
}
} catch (Exception e) {
}
String Password = [Link]();
try {
if ([Link]() < 2) {
[Link]("Enter a password");
}
} catch (Exception e) {
}
if (valid) {
try {
String name = [Link]();
String surname = [Link]();
String username = [Link]();
String password = new String([Link]());
FileWriter writer = new FileWriter("[Link]", true);
[Link](name + "#" + surname + "#" + email + "#" + username
+ "#" + password);
[Link]([Link]("[Link]"));
[Link]();
[Link](null, "Successfully signed up!");
setVisible(false);
PAT TITLE Technical and Testing Document Your Name Page 57
} catch (Exception e) {
[Link](null, "Error saving user data: " +
[Link]());
}
}
new Main().setVisible(true);
private void btnlogActionPerformed([Link] evt) {
// TODO add your handling code here:
[Link]();
new screen1().setVisible(true);
}
/**
* @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
[Link]
*/
try {
for ([Link] info :
[Link]()) {
if ("Nimbus".equals([Link]())) {
[Link]([Link]());
break;
}
}
} catch (ClassNotFoundException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
} catch (InstantiationException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
} catch (IllegalAccessException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
PAT TITLE Technical and Testing Document Your Name Page 58
} catch ([Link] ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
}
//</editor-fold>
/* Create and display the form */
[Link](new Runnable() {
public void run() {
new SignUp().setVisible(true);
}
});
}
// Variables declaration - do not modify
private [Link] LblEmailError;
private [Link] btnSignUp;
private [Link] btnlog;
private [Link] jButton2;
private [Link] jLabel1;
private [Link] jScrollPane1;
private [Link] jTextArea1;
private [Link] lblEmail;
private [Link] lblName;
private [Link] lblNameError;
private [Link] lblPassword;
private [Link] lblPasswordError;
private [Link] lblSignup;
private [Link] lblSurname;
private [Link] lblSurnameError;
private [Link] lblUser;
private [Link] lblUserError;
private [Link] pwfPassword;
private [Link] txfEmail;
public [Link] txfName;
private [Link] txfSurname;
private [Link] txfUsername;
// End of variables declaration
import [Link]; import [Link]; import [Link]; import
[Link];
/*
To change this license header, choose License Headers in Project Properties.
PAT TITLE Technical and Testing Document Your Name Page 59
To change this template file, choose Tools | Templates
and open the template in the editor.
/ /* *
@author Sales
*/ public class UserArray {
private UserClass[] users;
private int count;
// Borrowed Code
public UserArray(int size) {
users = new UserClass[size];
count = 0;
}
public void addUser(UserClass user) {
if (count < [Link]) {
users[count] = user;
count++;
}
}
// Borrowed Code
public void writeUsersToFile() throws IOException {
PrintWriter outFile = new PrintWriter(new FileWriter("[Link]"));
for (int i = 0; i < count; i++) {
[Link]("Username " + users[i].getUsername() + "Password" +
users[i].getPassword());
[Link]();
"title": "Glow App Help",
"sections": [
"topic": "Creating a Profile",
PAT TITLE Technical and Testing Document Your Name Page 60
"details": "Select your hair color, hair length, skin tone, and eye color using the combo boxes,
then click 'Save'."
},
"topic": "Viewing Your Routine",
"details": "Click the 'Routine' button to view your personalized skincare and haircare routine."
},
"topic": "Calculating Your Cart",
"details": "Click 'Calculate' to view all recommended products and the total cost in your cart."
import [Link]; import [Link]; import [Link]; import
[Link];
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
/ /* *
@author Sales
*/ public class screen1 extends [Link] {
/**
* Creates new form screen1
*/
public screen1() {
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")
PAT TITLE Technical and Testing Document Your Name Page 61
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
lblTitle = new [Link]();
lblEnterUser = new [Link]();
txtUser = new [Link]();
lblEnterPassword = new [Link]();
btnLogin = new [Link]();
txtPass = new [Link]();
setDefaultCloseOperation([Link].EXIT_ON_CLOSE);
setBackground(new [Link](255, 102, 153));
setFont(new [Link]("Calibri", 1, 12)); // NOI18N
setForeground(new [Link](255, 102, 102));
[Link]("Please Log in Diva");
[Link]("Enter Username");
[Link](" ");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
txtUserActionPerformed(evt);
}
});
[Link]("Enter Password ");
[Link]("Log In");
[Link](new [Link]() {
public void actionPerformed([Link] evt) {
btnLoginActionPerformed(evt);
}
});
[Link]("jPasswordField1");
[Link] layout = new
[Link](getContentPane());
getContentPane().setLayout(layout);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGap(42, 42, 42)
.addGroup([Link]([Link]
[Link])
.addComponent(lblEnterPassword)
.addComponent(lblEnterUser))
.addPreferredGap([Link]
ED, 109, Short.MAX_VALUE)
PAT TITLE Technical and Testing Document Your Name Page 62
.addGroup([Link]([Link]
[Link])
.addGroup([Link],
[Link]()
.addComponent(txtUser,
[Link].PREFERRED_SIZE, 73,
[Link].PREFERRED_SIZE)
.addGap(76, 76, 76))
.addGroup([Link],
[Link]()
.addComponent(txtPass,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addGap(60, 60, 60))))
.addGroup([Link]()
.addGap(137, 137, 137)
.addGroup([Link]([Link]
[Link])
.addComponent(lblTitle,
[Link].PREFERRED_SIZE, 96,
[Link].PREFERRED_SIZE)
.addGroup([Link]()
.addGap(15, 15, 15)
.addComponent(btnLogin)))
.addContainerGap([Link].DEFAULT_SIZE,
Short.MAX_VALUE))
);
[Link](
[Link]([Link])
.addGroup([Link]()
.addGap(46, 46, 46)
.addComponent(lblTitle)
.addGap(32, 32, 32)
.addGroup([Link]([Link]
[Link])
.addComponent(lblEnterUser)
.addComponent(txtUser,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGap(29, 29, 29)
.addGroup([Link]([Link]
[Link])
.addComponent(lblEnterPassword)
.addComponent(txtPass,
[Link].PREFERRED_SIZE, [Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addPreferredGap([Link]
ED, 51, Short.MAX_VALUE)
.addComponent(btnLogin)
.addGap(65, 65, 65))
);
PAT TITLE Technical and Testing Document Your Name Page 63
}// </editor-fold>
private void txtUserActionPerformed([Link] evt) {
// TODO add your handling code here:
private void btnLoginActionPerformed([Link] evt) {
// TODO add your handling code here:
Main newWindow = new Main();
[Link](true);
[Link]();
String username = [Link]().trim();
String password = new String([Link]()).trim();
boolean found = false;
try (Scanner sc = new Scanner(new File("[Link]"))) {
while ([Link]()) {
String line = [Link]();
String[] parts = [Link](",");
if ([Link] >= 2) {
String fileUser = parts[0].trim();
String filePass = parts[1].trim();
if ([Link](fileUser) && [Link](filePass)) {
found = true;
break;
}
}
}
} catch (FileNotFoundException e) {
[Link](this, "[Link] not found!");
}
if (found) {
[Link](this, "Login successful!");
} else {
[Link](this, "Invalid username or password.");
}
/**
PAT TITLE Technical and Testing Document Your Name Page 64
* @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
[Link]
*/
try {
for ([Link] info :
[Link]()) {
if ("Nimbus".equals([Link]())) {
[Link]([Link]());
break;
}
}
} catch (ClassNotFoundException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
} catch (InstantiationException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
} catch (IllegalAccessException ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
} catch ([Link] ex) {
[Link]([Link]()).log([Link]
[Link], null, ex);
}
//</editor-fold>
/* Create and display the form */
[Link](new Runnable() {
public void run() {
new screen1().setVisible(true);
}
});
}
// Variables declaration - do not modify
private [Link] btnLogin;
private [Link] lblEnterPassword;
private [Link] lblEnterUser;
PAT TITLE Technical and Testing Document Your Name Page 65
private [Link] lblTitle;
private [Link] txtPass;
private [Link] txtUser;
// End of variables declaration
PAT TITLE Technical and Testing Document Your Name Page 66