import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
public class SignIn extends JFrame implements ActionListener
{
FlowLayout flow = new FlowLayout();
JLabel label = new JLabel("Select Your Sport:");
JLabel label_1 = new JLabel("Body Part:");
JLabel label_2a = new JLabel("Upper Extremity");
JLabel label_2b = new JLabel("Lower Extremity");
JLabel label_2c = new JLabel("Head");
JLabel label_2d = new JLabel("Torso");
JLabel label_2e = new JLabel("General Medical");
JLabel label_3a = new JLabel("Side");
JLabel label_3b = new JLabel("Injury");
JLabel label_3c_a = new JLabel("Treatment");
JLabel label_3c_b = new JLabel("Treatment (Optional)");
final int FRAME_WIDTH = 600;
final int FRAME_HEIGHT = 400;
String[] sports = { "---", "Football", "Boy's Soccer", "Girl's Soccer", "Field Hockey", "Cross Country", "Tennis", "Boy's Basketball", "Girl's Basketball", "Wrestling", "Cheer", "Bowling", "Baseball", "Softball", "Boy's Lacrosse", "Girl's Lacrosse", "Track & Field", "Other"};
String[] bodyPart = { "---", "Upper Extremity", "Lower Extremity", "Head", "Torso", "General Medical"};
String[] upperExtremity = { "---", "Elbow", "Finger", "Forearm", "Hand", "Shoulder", "Thumb", "Upper Arm", "Wrist", "Other"};
String[] lowerExtremity = { "---", "Ankle", "Calf", "Foot", "Groin", "Heel", "Hip", "Knee", "Lower Leg", "Shin", "Thigh", "Toes", "Other"};
String[] head = { "---", "Brain", "Ear", "Eye", "Face", "Forehead", "Jaw", "Nose", "Scalp", "Skull", "Other"};
String[] torso = { "---", "Abdomen", "Back", "Cervical Spine", "Chest", "Clavicle", "Flank", "Lumber Spine", "Neck", "Rib", "Sacrum (Tailbone)", "Sternum", "Thoracic Spine", "Other"};
String[] generalMedical = { "---", "Side", "Injury", "Treatment", "Other"};
String[] side = { "---", "Right", "Left", "Midline", "Front", "Back", "Other"};
String[] injury = { "---", "Amputation", "Asphyxiation", "Bite", "Blister", "Burn", "Concussion", "Contusion/ Bruise", "Cut/ Laceration/ Abrasion", "Dislocation", "Fracture", "Hearing Loss", "Heat Illness", "Hypothermia", "Shock", "Shock", "Sore", "Sprain", "Strain", "Vision Loss", "Other" };
String[] treatment = { "---", "Bandage", "Brace/ Splint/ Cast", "Combo", "Contrast Bath", "Electrotherapy", "Hi-Volt", "Ice Bag/ Pack", "Ice Massage", "Inferential", "Massage", "Moist Heat Pack", "Muscle Stimulator", "Padding", "Paraffin", "Rehab Excercises", "Russian", "Stretch", "Tape", "TENS", "Ultrasound", "Whirlpool", "Wound Care", "Other"};
JComboBox size = new JComboBox(sports);
JComboBox size_1 = new JComboBox(bodyPart);
JComboBox size_2a = new JComboBox(upperExtremity);
JComboBox size_2b = new JComboBox(lowerExtremity);
JComboBox size_2c = new JComboBox(head);
JComboBox size_2d = new JComboBox(torso);
JComboBox size_2e = new JComboBox(generalMedical);
JComboBox size_3a = new JComboBox(side);
JComboBox size_3b = new JComboBox(injury);
JComboBox size_3c_a = new JComboBox(treatment);
JComboBox size_3c_b = new JComboBox(treatment);
public SignIn()
{
super("Athletic Trainer Sign In");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout (new FlowLayout());
getContentPane().setBackground(new Color(178, 178, 56));
//Sub Level 1 - Sport
label.setFont(new Font("Arial", Font.BOLD, 18));
label.setForeground(Color.white);
size.setFont(new Font("Arial", Font.BOLD, 22));
size.setForeground(Color.white);
size.setBackground(Color.blue);
add(label);
add(size);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
//Sub Level 1 - Body Part
label_1.setFont(new Font("Arial", Font.BOLD, 18));
label_1.setForeground(Color.white);
size_1.setFont(new Font("Arial", Font.BOLD, 22));
size_1.setForeground(Color.white);
size_1.setBackground(Color.blue);
add(label_1);
add(size_1);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
size_1.addActionListener(this);
//****************************************************
//Sub Level 3a - Side
label_3a.setFont(new Font("Arial", Font.BOLD, 18));
label_3a.setForeground(Color.white);
size_3a.setFont(new Font("Arial", Font.BOLD, 22));
size_3a.setForeground(Color.white);
size_3a.setBackground(Color.blue);
add(label_3a);
add(size_3a);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
//Sub Level 3b - Injury
label_3b.setFont(new Font("Arial", Font.BOLD, 18));
label_3b.setForeground(Color.white);
size_3b.setFont(new Font("Arial", Font.BOLD, 22));
size_3b.setForeground(Color.white);
size_3b.setBackground(Color.blue);
add(label_3b);
add(size_3b);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
//Sub Level 3c-a - Treatment
label_3c_a.setFont(new Font("Arial", Font.BOLD, 18));
label_3c_a.setForeground(Color.white);
size_3c_a.setFont(new Font("Arial", Font.BOLD, 22));
size_3c_a.setForeground(Color.white);
size_3c_a.setBackground(Color.blue);
add(label_3c_a);
add(size_3c_a);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
//Sub Level 3c-b - Treatment
label_3c_b.setFont(new Font("Arial", Font.BOLD, 18));
label_3c_b.setForeground(Color.white);
size_3c_b.setFont(new Font("Arial", Font.BOLD, 22));
size_3c_b.setForeground(Color.white);
size_3c_b.setBackground(Color.blue);
add(label_3c_b);
add(size_3c_b);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
}
//***********************************************************
public static void main(String[] args)
{
SignIn frame = new SignIn();
frame.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
String selectedValue = size_1.getSelectedItem().toString();
String[] combo2Item = null;
DefaultComboBoxModel model = (DefaultComboBoxModel) size_2a.getModel();
model.removeAllElements();
while(selectedValue.equals("Upper Extremity")){
combo2Item = new String[]{ "---", "Elbow", "Finger", "Forearm", "Hand", "Shoulder", "Thumb", "Upper Arm", "Wrist", "Other"};;
//Sub Level 2a - Upper Extremity
label_2a.setFont(new Font("Arial", Font.BOLD, 18));
label_2a.setForeground(Color.white);
size_2a.setFont(new Font("Arial", Font.BOLD, 22));
size_2a.setForeground(Color.white);
size_2a.setBackground(Color.blue);
add(label_2a);
add(size_2a);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
break;
} while(selectedValue.equals("Lower Extremity")){
combo2Item = new String[]{ "---", "Ankle", "Calf", "Foot", "Groin", "Heel", "Hip", "Knee", "Lower Leg", "Shin", "Thigh", "Toes", "Other"};
//Sub Level 2b - Lower Extremity
label_2b.setFont(new Font("Arial", Font.BOLD, 18));
label_2b.setForeground(Color.white);
size_2b.setFont(new Font("Arial", Font.BOLD, 22));
size_2b.setForeground(Color.white);
size_2b.setBackground(Color.blue);
add(label_2b);
add(size_2b);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
break;
} while(selectedValue.equals("Head")){
combo2Item = new String[]{ "---", "Brain", "Ear", "Eye", "Face", "Forehead", "Jaw", "Nose", "Scalp", "Skull", "Other"};
//Sub Level 2c - Head
label_2c.setFont(new Font("Arial", Font.BOLD, 18));
label_2c.setForeground(Color.white);
size_2c.setFont(new Font("Arial", Font.BOLD, 22));
size_2c.setForeground(Color.white);
size_2c.setBackground(Color.blue);
add(label_2c);
add(size_2c);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
break;
} while(selectedValue.equals("Torso")){
combo2Item = new String[]{ "---", "Abdomen", "Back", "Cervical Spine", "Chest", "Clavicle", "Flank", "Lumber Spine", "Neck", "Rib", "Sacrum (Tailbone)", "Sternum", "Thoracic Spine", "Other"};
//Sub Level 2d - Torso
label_2d.setFont(new Font("Arial", Font.BOLD, 18));
label_2d.setForeground(Color.white);
size_2d.setFont(new Font("Arial", Font.BOLD, 22));
size_2d.setForeground(Color.white);
size_2d.setBackground(Color.blue);
add(label_2d);
add(size_2d);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
break;
} while(selectedValue.equals("General Medical")){
combo2Item = new String[]{ "---", "Side", "Injury", "Treatment", "Other"};;
//Sub Level 2e - General Medical
label_2e.setFont(new Font("Arial", Font.BOLD, 18));
label_2e.setForeground(Color.white);
size_2e.setFont(new Font("Arial", Font.BOLD, 22));
size_2e.setForeground(Color.white);
size_2e.setBackground(Color.blue);
add(label_2e);
add(size_2e);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
break;
}
for(String val : combo2Item){
model.addElement(val);
}
}
}