-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFBLACodingAndProgramming.java
More file actions
2977 lines (2718 loc) · 90.8 KB
/
FBLACodingAndProgramming.java
File metadata and controls
2977 lines (2718 loc) · 90.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*Chat Tea
Poke Delight
EastBrew Cafe and Bakery
JINYA Ramen Bar
Starbucks
Panera Bread
Tacos Del Rio
McDonald’s
Yoshiharu Ramen
Golden Chopsticks
ZIP Sushi
Pinkberry
ChickFilA
Miguel’s Jr.
Taco Bell
InNOut Burger
Target
Vons
TJ Max
ROSS
Q
Dick’s Sporting Goods
Gemma's Jewelers
Kohl’s
Tillys
Famous Footwear
Home Goods
99 Cents Only Stores
Eatsvale
EEKVALE
Eastvale Lunar Festival
Miracle On Citrus St.
Picnic In The Park2
9/11 Memorial
Massage Envy Spa Eastvale
The Joint Chiropractic
Mes Amies Nail & Beauty Spa
The Pretty Kitty
Great Clips
Supercuts
LUXE 9 Nail & Spa
Revol Nail Spa
Harada Heritage Park
Cedar Creek Park
River Walk Park
Orchard Park
American Heroes Park
SilverLakes
Edwards Eastvale Gateway Stadium 14
Half Moon Park
McCune Family Park
*/
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.border.LineBorder;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import java.awt.Font;
import java.awt.Window;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import net.miginfocom.swing.MigLayout;
import javax.swing.JLayeredPane;
import javax.swing.JTabbedPane;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Scrollbar;
import java.awt.Checkbox;
import java.beans.PropertyChangeListener;
import java.net.URL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Wrapper;
import java.util.ArrayList;
import java.beans.PropertyChangeEvent;
import javax.swing.JCheckBox;
import javax.swing.JRadioButton;
import java.awt.Component;
import javax.swing.ImageIcon;
import javax.swing.JScrollPane;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.UIManager;
public class FBLACodingAndProgramming extends JFrame {
//launching the application
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
FBLACodingAndProgramming frame = new FBLACodingAndProgramming();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
//creates identifiers to store which attraction is selected
String restaurantselected = "";
String entertainmentselected = "";
String eventsselected = "";
String personalserviceselected = "";
String shoppingselected ="";
String getValue="";
//creates identifiers to store which attraction is selected for YELP link
String shop = "";
String ryelp = "";
String pyelp = "";
//connects database to application
static final String DB_URL = "jdbc:mysql://localhost/login";
static final String USER = "root";
static final String PASS = "18187720";
protected static final String String = null;
private JTextField textinput;
public static int count = 0;
public FBLACodingAndProgramming() {
//creates the application panel as a whole
JPanel contentPane;
contentPane = new JPanel();
contentPane.setBackground(new Color(100, 149, 237));
contentPane.setBorder(new LineBorder(new Color(65, 105, 225)));
setContentPane(contentPane);
contentPane.setLayout(null);
setUndecorated(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 600, 400);
//creates X button to leave application
JLabel lblX = new JLabel("X");
lblX.setBackground(Color.BLACK);
lblX.setBounds(570, 0, 30, 30);
lblX.setForeground(new Color(255, 255, 255));
lblX.setFont(new Font("Comic Sans MS", Font.BOLD, 17));
lblX.setHorizontalAlignment(SwingConstants.CENTER);
contentPane.add(lblX);
//when user clicks on the X button they can choose to leave application
lblX.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if(JOptionPane.showConfirmDialog(null, "Are you sure you want to close this application?", "Confirmation", JOptionPane.YES_NO_OPTION) == 0)
{
FBLACodingAndProgramming.this.dispose();
}
}
@Override
public void mouseEntered(MouseEvent e) {
lblX.setForeground(Color.RED);
}
@Override
public void mouseExited(MouseEvent e) {
lblX.setForeground(Color.WHITE);
}
});
JPanel lightbluetop_1 = new JPanel();
lightbluetop_1.setBackground(new Color(176, 196, 222));
lightbluetop_1.setBounds(0, 0, 600, 34);
contentPane.add(lightbluetop_1);
lightbluetop_1.setLayout(null);
//creates icon for the help button
ImageIcon h = new ImageIcon("help.png");
//creates panel where the 5 options are
JPanel choosing = new JPanel();
choosing.setBackground(new Color(100, 149, 237));
choosing.setBounds(10, 0, 600, 400);
contentPane.add(choosing);
choosing.setForeground(new Color(0, 0, 0));
choosing.setLayout(null);
choosing.setVisible(false);
JLabel helpbutton = new JLabel("");
helpbutton.setHorizontalAlignment(SwingConstants.CENTER);
helpbutton.setIcon(h);
//creates the light blue top portion of application
JPanel lightbluetop = new JPanel();
lightbluetop.setBounds(0, 0, 600, 34);
choosing.add(lightbluetop);
lightbluetop.setBackground(new Color(176, 196, 222));
helpbutton.setBounds(45, 344, 55, 56);
choosing.add(helpbutton);
//creates events button
JButton events = new JButton("Events");
events.setBounds(221, 191, 143, 44);
choosing.add(events);
//creates shopping button
JButton shopping = new JButton("Shopping");
shopping.setBounds(221, 135, 143, 44);
choosing.add(shopping);
//creates restaurants button
JButton restaurants = new JButton("Restaurants");
restaurants.setBackground(new Color(0, 0, 205));
restaurants.setBounds(221, 75, 143, 44);
choosing.add(restaurants);
JButton personalservices = new JButton("Personal Services");
personalservices.setBounds(221, 249, 143, 45);
choosing.add(personalservices);
JPanel help = new JPanel();
help.setBackground(new Color(100, 149, 237));
help.setBounds(0, 0, 600, 400);
contentPane.add(help);
help.setLayout(null);
help.setVisible(false);
//when user clicks help button they will be taken to forum
helpbutton.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
help.setVisible(true);
choosing.setVisible(false);
lightbluetop.setVisible(true);
}
});
textinput = new JTextField();
textinput.setBounds(68, 336, 415, 46);
help.add(textinput);
textinput.setColumns(10);
JLabel computer = new JLabel("Hi! What can I help you with?");
computer.setBounds(60, 71, 292, 33);
help.add(computer);
JLabel user = new JLabel("");
user.setHorizontalAlignment(SwingConstants.RIGHT);
user.setBounds(237, 104, 292, 33);
help.add(user);
JLabel computer1 = new JLabel("");
computer1.setHorizontalAlignment(SwingConstants.LEFT);
computer1.setBounds(60, 144, 292, 33);
help.add(computer1);
JLabel user1 = new JLabel("");
user1.setHorizontalAlignment(SwingConstants.RIGHT);
user1.setBounds(237, 189, 292, 33);
help.add(user1);
JLabel computer2 = new JLabel("");
computer2.setHorizontalAlignment(SwingConstants.LEFT);
computer2.setBounds(60, 234, 292, 33);
help.add(computer2);
JLabel user2 = new JLabel("");
user2.setHorizontalAlignment(SwingConstants.RIGHT);
user2.setBounds(237, 268, 292, 33);
help.add(user2);
JButton btnNewButton = new JButton("ENTER");
btnNewButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
boolean flag=false;
count++;
getValue = textinput.getText();
if (count==1)
{
user.setText(getValue);
}
else if (count==2)
{
user1.setText(getValue);
}
else if (count==3)
{
user2.setText(getValue);
}
else
{
String a = user1.getText();
String b = user2.getText();
user.setText(a);
user1.setText(b);
user2.setText(getValue);
}
try {
String data = "jdbc:mysql://localhost/qanda";
Connection conn = DriverManager.getConnection(data, "root", "18187720");
Statement st = conn.createStatement();
ResultSet rec = st.executeQuery("SELECT question, answer FROM q");
while (rec.next()) {
String x = textinput.getText();
if (x.equals(rec.getString("question")))
{
if (count==1)
{
computer1.setText(rec.getString("answer"));
}
else if (count==2)
{
computer2.setText(rec.getString("answer"));
}
else
{
String a = computer1.getText();
String b = computer2.getText();
computer.setText(a);
computer1.setText(b);
computer2.setText(rec.getString("answer"));
}
flag=true;
}
}
st.close();
}
catch(SQLException d) {
System.out.println(d.toString());
}
if (flag==false)
{
String ss = textinput.getText();
Wrapper conn = null;
try
{
String IQuery = "INSERT INTO `qanda`.`q`(`question`) VALUES('"+ss+"')";
conn = DriverManager.getConnection(DB_URL, USER, PASS);
((Connection)conn).createStatement().execute(IQuery);
((java.sql.Connection)conn).close();
}
catch (SQLException se)
{
se.printStackTrace();
}
catch (Exception a)
{
a.printStackTrace();
}
if (count==1)
{
computer1.setText("Sorry, we don't have an answer right now!");
}
else if (count==2)
{
computer2.setText("Sorry, we don't have an answer right now!");
}
else
{
String a = computer1.getText();
String b = computer2.getText();
computer.setText(a);
computer1.setText(b);
computer2.setText("Sorry, we don't have an answer right now!");
}
}
}
});
btnNewButton.setBounds(489, 341, 105, 39);
help.add(btnNewButton);
JButton questionback = new JButton("←");
questionback.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
choosing.setVisible(true);
help.setVisible(false);
}
});
questionback.setBounds(6, 341, 55, 39);
help.add(questionback);
//ButtonGroups - allows user to only choose one radio button at a time
ButtonGroup cuisinegroup = new ButtonGroup();
ButtonGroup group = new ButtonGroup();
ButtonGroup goodssold = new ButtonGroup();
ButtonGroup shoppingprice = new ButtonGroup();
ButtonGroup seasons = new ButtonGroup();
ButtonGroup activities = new ButtonGroup();
ButtonGroup eventprice= new ButtonGroup();
ButtonGroup restuarantprice = new ButtonGroup();
ButtonGroup personalserviceprice = new ButtonGroup();
ButtonGroup service = new ButtonGroup();
ButtonGroup entertainmentserviceprice = new ButtonGroup();
ButtonGroup trail = new ButtonGroup();
ButtonGroup appoint = new ButtonGroup();
ButtonGroup analyze = new ButtonGroup();
//creates login info
JTextField txtUsername;
JTextField txtPassword;
JLabel lblLoginMessage = new JLabel("");
// creates username panel
JPanel username = new JPanel();
username.setBounds(168, 110, 283, 37);
username.setBackground(new Color(255, 255, 255));
contentPane.add(username);
username.setLayout(null);
// creates username textbox
txtUsername = new JTextField();
txtUsername.setBorder(null);
txtUsername.setText("Username");
txtUsername.setBounds(6, 6, 239, 26);
username.add(txtUsername);
txtUsername.setColumns(10);
// creates password panel
JPanel password = new JPanel();
password.setBounds(168, 174, 283, 37);
password.setBackground(new Color(255, 255, 255));
contentPane.add(password);
password.setLayout(null);
//creates password textbox
txtPassword = new JTextField();
txtPassword.setBorder(null);
txtPassword.setText("Password");
txtPassword.setBounds(6, 6, 239, 26);
password.add(txtPassword);
txtPassword.setColumns(10);
//creates signup panel
JPanel signup = new JPanel();
signup.setBounds(168, 340, 279, 50);
signup.setBackground(new Color(25, 25, 112));
contentPane.add(signup);
signup.setLayout(null);
//put username/password into the database
signup.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
Wrapper conn = null;
try
{
String username = "";
String password = "";
username = txtUsername.getText();
password = txtPassword.getText();
if (username.equals("")|| password.equals(""))
{
lblLoginMessage.setText("Invalid Information");
}
else
{
String IQuery = "INSERT INTO `login`.`account`(`username`,`password`) VALUES('"+username+"', '"+password+"')";
lblLoginMessage.setText("Signed up!");
conn = DriverManager.getConnection(DB_URL, USER, PASS);
((Connection)conn).createStatement().execute(IQuery);
((java.sql.Connection)conn).close();
}
}
catch (SQLException se)
{
se.printStackTrace();
}
catch (Exception a)
{
a.printStackTrace();
}
}
});
// creates signup label
JLabel lblSignup = new JLabel("SIGN UP");
lblSignup.setBounds(114, 10, 60, 39);
lblSignup.setForeground(new Color(255, 255, 255));
signup.add(lblSignup);
//creates login panel
JPanel login = new JPanel();
login.setBounds(168, 275, 279, 50);
login.setBackground(new Color(25, 25, 112));
contentPane.add(login);
login.setLayout(null);
//checks if username/password inputted matches with anything in the database
login.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
try {
String data = "jdbc:mysql://localhost/login";
Connection conn = DriverManager.getConnection(data, "root", "18187720");
Statement st = conn.createStatement();
ResultSet rec = st.executeQuery("SELECT username, password FROM account");
while (rec.next()) {
String x = txtUsername.getText();
String y = txtPassword.getText();
if (x.equals(rec.getString("username"))) {
if (y.equals(rec.getString("password"))) {
login.setVisible(false);
username.setVisible(false);
password.setVisible(false);
signup.setVisible(false);
lblLoginMessage.setVisible(false);
choosing.setVisible(true);
}
} else {
lblLoginMessage.setText("Invalid Information");
}
}
st.close();
}
catch(SQLException d) {
System.out.println(d.toString());
}
}
}
);
//creates login title
JLabel lblLogin = new JLabel("LOG IN");
lblLogin.setBounds(114, 6, 50, 39);
lblLogin.setForeground(new Color(255, 255, 255));
login.add(lblLogin);
lblLoginMessage.setBounds(168, 234, 283, 29);
contentPane.add(lblLoginMessage);
// get images used for shopping panel
ImageIcon famous = new ImageIcon("famous.jpeg");
ImageIcon sporting = new ImageIcon("sporting.jpeg");
ImageIcon tj = new ImageIcon("tj.png");
ImageIcon ross = new ImageIcon("ross.jpeg");
ImageIcon q = new ImageIcon("q.jpeg");
ImageIcon kohl = new ImageIcon("kohl.jpeg");
ImageIcon target = new ImageIcon("target.jpeg");
ImageIcon gemma = new ImageIcon("gemma.jpeg");
ImageIcon homegood = new ImageIcon("homegood.jpeg");
ImageIcon ninety = new ImageIcon("ninety.jpeg");
ImageIcon vons = new ImageIcon("vons.jpeg");
ImageIcon tilly = new ImageIcon("tilly.jpeg");
//creates personal services panel
JPanel personalservicespanel = new JPanel();
personalservicespanel.setBackground(new Color(100, 149, 237));
personalservicespanel.setVisible(false);
personalservices.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
choosing.setVisible(false);
personalservicespanel.setVisible(true);
lightbluetop.setVisible(false);
lightbluetop_1.setVisible(false);
}
});
//goes back to main page
choosing.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
choosing.setVisible(true);
personalservicespanel.setVisible(false);
lightbluetop.setVisible(true);
}
});
//creates shopping panel
JPanel shoppingpanel = new JPanel();
shoppingpanel.setVisible(false);
shoppingpanel.setBackground(new Color(100, 149, 237));
shoppingpanel.setBounds(0, 0, 600, 400);
contentPane.add(shoppingpanel);
shoppingpanel.setLayout(null);
shopping.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
choosing.setVisible(false);
shoppingpanel.setVisible(true);
lightbluetop_1.setVisible(false);
}
});
//creates dark blue portion on left hand side
JPanel panel1 = new JPanel();
panel1.setBackground(new Color(0, 0, 128));
panel1.setBounds(0, 0, 258, 400);
shoppingpanel.add(panel1);
panel1.setLayout(null);
//below are the creation of labels
JLabel Price_1 = new JLabel("Price");
Price_1.setBounds(11, 19, 30, 16);
Price_1.setForeground(Color.WHITE);
Price_1.setFont(new Font("Arial", Font.PLAIN, 13));
Price_1.setBackground(Color.WHITE);
panel1.add(Price_1);
JLabel GoodsSold = new JLabel("Goods Sold");
GoodsSold.setBounds(11, 121, 92, 16);
panel1.add(GoodsSold);
GoodsSold.setForeground(Color.WHITE);
GoodsSold.setFont(new Font("Arial", Font.PLAIN, 13));
GoodsSold.setBackground(Color.WHITE);
JLabel PickupOptions = new JLabel("Pickup Options");
PickupOptions.setForeground(Color.WHITE);
PickupOptions.setFont(new Font("Arial", Font.PLAIN, 13));
PickupOptions.setBackground(Color.WHITE);
PickupOptions.setBounds(11, 271, 92, 16);
panel1.add(PickupOptions);
JLabel Payment1 = new JLabel("Payment");
Payment1.setForeground(Color.WHITE);
Payment1.setFont(new Font("Arial", Font.PLAIN, 13));
Payment1.setBackground(Color.WHITE);
Payment1.setBounds(129, 19, 70, 16);
panel1.add(Payment1);
//below are the creations of the buttons
JRadioButton Clothing = new JRadioButton("Clothing");
Clothing.setActionCommand("Clothing");
Clothing.setForeground(new Color(255, 255, 255));
Clothing.setBounds(6, 141, 95, 23);
panel1.add(Clothing);
JRadioButton Footwear = new JRadioButton("Footwear");
Footwear.setForeground(Color.WHITE);
Footwear.setBounds(6, 164, 95, 23);
panel1.add(Footwear);
JRadioButton Decor = new JRadioButton("Decor");
Decor.setForeground(Color.WHITE);
Decor.setBounds(6, 188, 95, 23);
panel1.add(Decor);
JRadioButton FoodProducts = new JRadioButton("Food Products");
FoodProducts.setForeground(Color.WHITE);
FoodProducts.setBounds(6, 212, 122, 23);
panel1.add(FoodProducts);
JRadioButton Jewelry = new JRadioButton("Jewelry");
Jewelry.setForeground(Color.WHITE);
Jewelry.setBounds(6, 236, 95, 23);
panel1.add(Jewelry);
JRadioButton onedollarsign_2_1 = new JRadioButton("$");
onedollarsign_2_1.setForeground(Color.WHITE);
onedollarsign_2_1.setBounds(6, 38, 81, 23);
panel1.add(onedollarsign_2_1);
JRadioButton twodollar_1 = new JRadioButton("$$");
twodollar_1.setForeground(Color.WHITE);
twodollar_1.setBounds(6, 62, 81, 23);
panel1.add(twodollar_1);
JRadioButton threedollarsign_2_1 = new JRadioButton("$$$");
threedollarsign_2_1.setForeground(Color.WHITE);
threedollarsign_2_1.setBounds(6, 85, 76, 23);
panel1.add(threedollarsign_2_1);
//groups buttons so user can only choose one
goodssold.add(Clothing);
goodssold.add(Footwear);
goodssold.add(Decor);
goodssold.add(FoodProducts);
goodssold.add(Jewelry);
shoppingprice.add(onedollarsign_2_1);
shoppingprice.add(twodollar_1);
shoppingprice.add(threedollarsign_2_1);
//below are the creation of checkboxes
JCheckBox walkin = new JCheckBox("Walk In");
walkin.setForeground(Color.WHITE);
walkin.setFont(new Font("Arial", Font.PLAIN, 13));
walkin.setBackground(Color.WHITE);
walkin.setBounds(6, 291, 76, 23);
panel1.add(walkin);
JCheckBox Curbside = new JCheckBox("Curbside");
Curbside.setForeground(Color.WHITE);
Curbside.setFont(new Font("Arial", Font.PLAIN, 13));
Curbside.setBackground(Color.WHITE);
Curbside.setBounds(6, 315, 95, 23);
panel1.add(Curbside);
JCheckBox ApplePayment = new JCheckBox("Apple Payment");
ApplePayment.setForeground(Color.WHITE);
ApplePayment.setFont(new Font("Arial", Font.PLAIN, 13));
ApplePayment.setBackground(Color.WHITE);
ApplePayment.setBounds(123, 38, 122, 23);
panel1.add(ApplePayment);
JCheckBox GooglePayment = new JCheckBox("Google Payment");
GooglePayment.setForeground(Color.WHITE);
GooglePayment.setFont(new Font("Arial", Font.PLAIN, 13));
GooglePayment.setBackground(Color.WHITE);
GooglePayment.setBounds(123, 62, 129, 23);
panel1.add(GooglePayment);
JCheckBox creditdebit1 = new JCheckBox("Credit/Debit");
creditdebit1.setForeground(Color.WHITE);
creditdebit1.setFont(new Font("Arial", Font.PLAIN, 13));
creditdebit1.setBackground(Color.WHITE);
creditdebit1.setBounds(123, 84, 106, 23);
panel1.add(creditdebit1);
JCheckBox cash1 = new JCheckBox("Cash");
cash1.setForeground(Color.WHITE);
cash1.setFont(new Font("Arial", Font.PLAIN, 13));
cash1.setBackground(Color.WHITE);
cash1.setBounds(123, 105, 106, 23);
panel1.add(cash1);
// "enter" button for shopping
JButton shoppinggo = new JButton("→");
shoppinggo.setBounds(144, 350, 92, 44);
panel1.add(shoppinggo);
shoppinggo.setForeground(new Color(0, 0, 128));
shoppinggo.setFont(new Font("Lucida Grande", Font.PLAIN, 40));
shoppinggo.setBackground(new Color(0, 0, 128));
// creates button for going back
JButton shoppinggo_1 = new JButton("←");
shoppinggo_1.setActionCommand("");
shoppinggo_1.setForeground(new Color(0, 0, 128));
shoppinggo_1.setFont(new Font("Lucida Grande", Font.PLAIN, 40));
shoppinggo_1.setBackground(new Color(0, 0, 128));
shoppinggo_1.setBounds(27, 350, 92, 44);
panel1.add(shoppinggo_1);
//returns user to the option choices pages when clicked
shoppinggo_1.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
shoppingpanel.setVisible(false);
choosing.setVisible(true);
lightbluetop.setVisible(true);
}
});
//creation of label for shopping image
JLabel shoppingprint = new JLabel("");
shoppingprint.setHorizontalAlignment(SwingConstants.CENTER);
shoppingprint.setFont(new Font("Arial", Font.PLAIN, 20));
shoppingprint.setBounds(276, 308, 300, 36);
shoppingpanel.add(shoppingprint);
//creation of label for shopping image source
JLabel shoppingsource = new JLabel("");
shoppingsource.setHorizontalAlignment(SwingConstants.CENTER);
shoppingsource.setForeground(Color.WHITE);
shoppingsource.setBounds(285, 238, 280, 16);
shoppingpanel.add(shoppingsource);
// prints out where we got the picture from
JLabel shoppingpic = new JLabel("");
shoppingpic.setBounds(270, 31, 314, 248);
shoppingpanel.add(shoppingpic);
shoppingpic.setHorizontalAlignment(SwingConstants.CENTER);
shoppingpic.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
if (shoppingselected!="")
{
shoppingsource.setText("Picture By "+ shoppingselected);
}
}
@Override
public void mouseExited(MouseEvent e) {
shoppingsource.setText("");
}
});
//picks a shopping place
shoppinggo.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
shop="";
shoppingpic.setVisible(true);
if (Footwear.isSelected())
{
shop = "Famous Footwear";
shoppingprint.setText("Famous Footwear");
shoppingpic.setIcon(famous);
shoppingselected = "Mapsus.net";
}
else if (Clothing.isSelected())
{
String[] clothes = {"Dick's Sporting Goods", "Kohl's"};
String[] one = {"TJ Max", "Ross", "Q"};
if (threedollarsign_2_1.isSelected())
{
shoppingprint.setText("None");
shoppingpic.setVisible(false);
shoppingselected = "";
}
else if (twodollar_1.isSelected())
{
if (Curbside.isSelected() || GooglePayment.isSelected() || ApplePayment.isSelected())
{
String c = clothes[(int)Math.floor(Math.random()*(1-0+1)+0)];
shoppingprint.setText(c);
shop = c;
if (c.equals("Dick's Sporting Goods"))
{
shoppingpic.setIcon(sporting);
shoppingselected = "City of Eastvale";
}
else
{
shoppingpic.setIcon(kohl);
shoppingselected = "Foursquare";
}
}
else
{
shop = "Tillys";
shoppingprint.setText("Tillys");
shoppingpic.setIcon(tilly);
shoppingselected = "Tillys";
}
}
else if (onedollarsign_2_1.isSelected())
{
if (Curbside.isSelected())
{
shop = "Target";
shoppingprint.setText("Target");
shoppingpic.setIcon(target);
shoppingselected = "Lewis Retail Centers";
}
else if (GooglePayment.isSelected() || ApplePayment.isSelected())
{
String o = one[(int)Math.floor(Math.random()*(2-0+1)+0)];
shoppingprint.setText(o);
shop = o;
if (o.equals("TJ Max"))
{
shoppingpic.setIcon(tj);
shoppingselected = "24/7 Headline News";
}
else if (o.equals("Ross"))
{
shoppingpic.setIcon(ross);
shoppingselected = "Merlone Geier Partners";
}
else
{
shoppingpic.setIcon(q);
shoppingselected = "Fashion Q";
}
}
else
{
shop = "Target";
shoppingprint.setText("Target");
shoppingpic.setIcon(target);
shoppingselected = "Lewis Retail Centers";
}
}
else
{
shoppingprint.setText("Choose a price!");
shoppingpic.setVisible(false);
shoppingselected = "";
}
}
else if (Jewelry.isSelected())
{
shop = "Gemmas's Jewelers";
shoppingprint.setText("Gemmas's Jewelers");
shoppingpic.setIcon(gemma);
shoppingselected = "Gemma's Jewelers";
}
else if (Decor.isSelected())
{
shop = "HomeGoods";
shoppingprint.setText("HomeGoods");
shoppingpic.setIcon(homegood);
shoppingselected = "HomeGoods";
}
else if (FoodProducts.isSelected())
{
if (GooglePayment.isSelected()==true || Curbside.isSelected()==true)
{
shop = "Target";
shoppingprint.setText("Target");
shoppingpic.setIcon(target);
shoppingselected = "Lewis Retail Centers";
}
else if (onedollarsign_2_1.isSelected())
{
shop = "99 Cents Store";
shoppingprint.setText("99 Cents Store");
shoppingpic.setIcon(ninety);
shoppingselected = "99 Cents Store";
}
else
{
shop = "Vons";
shoppingprint.setText("Vons");
shoppingpic.setIcon(vons);
shoppingselected = "";
}
}
else
{
shoppingprint.setText("Choose a good's sold");
shoppingpic.setVisible(false);
}
}
});
//when YELP button is clicked user is taken to the YELP review
JButton shoppingyelp = new JButton("YELP Reviews");
shoppingyelp.setBounds(300, 354, 248, 40);
shoppingpanel.add(shoppingyelp);
shoppingyelp.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (shop.equals("Famous Footwear"))
{
try {
Desktop.getDesktop().browse(new URL("https://www.yelp.com/biz/famous-footwear-mira-loma").toURI());
}
catch (Exception e1)
{}
}
else if (shop.equals("Dick's Sporting Goods"))
{
try {
Desktop.getDesktop().browse(new URL("https://www.yelp.com/biz/dicks-sporting-goods-eastvale-2").toURI());
}
catch (Exception e1)
{}
}
if (shop.equals("Kohl's"))
{
try {
Desktop.getDesktop().browse(new URL("https://www.yelp.com/biz/kohls-mira-loma-mira-loma?osq=kohl%27s").toURI());
}
catch (Exception e1)
{}
}
if (shop.equals("TJ Max"))
{
try {
Desktop.getDesktop().browse(new URL("https://www.yelp.com/biz/tj-maxx-mira-loma?osq=tj+maxx").toURI());
}
catch (Exception e1)
{}
}
if (shop.equals("Ross"))
{
try {
Desktop.getDesktop().browse(new URL("https://www.yelp.com/search?find_desc=ross+store&find_loc=Eastvale%2C+CA").toURI());
}
catch (Exception e1)
{}
}
if (shop.equals("Q"))
{
try {
Desktop.getDesktop().browse(new URL("https://www.google.com/search?q=fashion+q+eastvale+ca&rlz=1C5CHFA_enUS909US909&oq=fashion+q&aqs=chrome.0.69i59j69i57j0i402l2j0i433i512j69i60l3.1828j0j7&sourceid=chrome&ie=UTF-8#lrd=0x80dcb58b194f9899:0x18affee4c516e36e,1,,,").toURI());
}
catch (Exception e1)
{}
}
if (shop.equals("Tillys"))
{
try {
Desktop.getDesktop().browse(new URL("https://www.yelp.com/biz/tillys-mira-loma?osq=tilly%27s").toURI());
}
catch (Exception e1)
{}
}
if (shop.equals("Target"))
{
try {
Desktop.getDesktop().browse(new URL("https://www.yelp.com/biz/target-mira-loma-2?osq=target").toURI());
}
catch (Exception e1)