W4R5 - 'AddProfile' Functionality

This commit is contained in:
bobbert committed 2025-02-16 02:21:05 +00:00
1 parent ef5dd52711
commit cd66e218f3
9 files changed
+112 -2

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="userprofilebuilder" />
</profile>
</annotationProcessing>
</component>
</project>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK" />
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
@@ -1,9 +1,13 @@
package userprofilebuilder.model;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.ActionListener;
import com.sun.tools.javac.Main;
import userprofilebuilder.view.MainViewer;
public class UserProfile {
public static void footer(JPanel tab)
@@ -20,6 +24,7 @@ public class UserProfile {
JButton addProfile = new JButton("Add Profile");
ActionListener adder = e -> {
System.out.println("profile add button clicked");
Adder();
};
addProfile.addActionListener(adder);
@@ -32,7 +37,49 @@ public class UserProfile {
}
public static void Adder()
{
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(0,1));
JTextField JT1 = new JTextField("Enter Profile name");
JLabel JT11 = new JLabel("Profile:");
panel.add(JT11);
panel.add(JT1);
JTextField JT2 = new JTextField("Enter Title");
JLabel JT21 = new JLabel("Title:");
panel.add(JT21);
panel.add(JT2);
JTextField JT3 = new JTextField("Enter Name");
JLabel JT31 = new JLabel("Name:");
panel.add(JT31);
panel.add(JT3);
JTextField JT4 = new JTextField("Enter Email");
JLabel JT41 = new JLabel("Email:");
panel.add(JT41);
panel.add(JT4);
//JOptionPane pane = new JOptionPane(panel, 3, 2); // content of dialogue box
JOptionPane pane = new JOptionPane(panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
JDialog dialog = pane.createDialog("Rename Dialogue Box"); // title of dialogue box
dialog.setVisible(true); // changed boiler plate code from .show() to .setVisible(true) because apparently IDE says it's better!!
// actions.
int choice = (int) pane.getValue();
if (choice == JOptionPane.OK_OPTION)
{
System.out.println("OK option pressed.");
} else if (choice == JOptionPane.CANCEL_OPTION) {
System.out.println("Cancel option pressed.");
dialog.dispose();
}
}
@@ -26,6 +26,8 @@ public class MainViewer {
public ArrayList<JRadioButton> radioButtons = new ArrayList<>();
int TotalRows;
public JTabbedPane JT;
public int a = UserGroup.getLine(file); // this represents a value that is to declare how many rows are to be made -- to be changed by the amount of lines in csv. ROW COUNT
@@ -156,7 +158,7 @@ public class MainViewer {
JTabbedPane JT = new JTabbedPane();
JT = new JTabbedPane();
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("file");
+1 -1
View File
@@ -1,3 +1,3 @@
User1,Dr,David Livingstone,d.livingstone@kingston.ac.uk
User2,test,Dave Livingstone,dave@googlemail.com
User2,Mr,Dave Livingstone,dave@googlemail.com
User3,HRH,DextroseDave,dex@twitter.com
1 User1 Dr David Livingstone d.livingstone@kingston.ac.uk
2 User2 test Mr Dave Livingstone dave@googlemail.com
3 User3 HRH DextroseDave dex@twitter.com