File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ import screens .Profile_screen .UserSearchUI ;
2
+ import screens .profile_update_screen .UserModificationUI ;
3
+ import javax .swing .*;
4
+ import java .awt .*;
5
+ import java .util .Objects ;
6
+
7
+
8
+ /**
9
+ * Provides the main appl UI.
10
+ */
11
+ public class Main {
12
+ public static void main (String [] args ) {
13
+ final JFrame f = new JFrame ();
14
+ f .setSize (400 , 200 );
15
+ f .setDefaultCloseOperation (WindowConstants .EXIT_ON_CLOSE );
16
+ f .setLayout (new FlowLayout ());
17
+
18
+ // to select feature that user wants to change
19
+ JLabel lbl = new JLabel ("<html>Select what you would like to do:</html>" );
20
+ lbl .setVisible (true );
21
+ lbl .setBounds (10 , 25 , 100 , 25 );
22
+ String [] choices = {"Search for users" , "Modify my profile" };
23
+ final JComboBox <String > cb = new JComboBox <>(choices );
24
+
25
+
26
+ JButton btn = new JButton ("OK" );
27
+
28
+ btn .addActionListener (e -> {
29
+ String feature = Objects .requireNonNull (cb .getSelectedItem ()).toString ();
30
+ switch (feature ) {
31
+ case "Search for users" :
32
+ new UserSearchUI ();
33
+ break ;
34
+ case "Modify my profile" :
35
+ new UserModificationUI ();
36
+ break ;
37
+ }
38
+ });
39
+
40
+ f .setTitle ("SOLID Chat main menu" );
41
+ f .add (lbl );
42
+ f .add (cb );
43
+ f .add (btn );
44
+ f .setVisible (true );
45
+
46
+ }
47
+ }
48
+
You can’t perform that action at this time.
0 commit comments