Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 6 CSE205 ASU This is Assignment 6 from CSE205 at ASU.There is a class called coursePane which needs to be filled out. So I
Assignment 6 CSE205 ASU
This is Assignment 6 from CSE205 at ASU.There is a class called coursePane which needs to be filled out. So I need the code of this class.
i need it complete, that is the thing i need
Add Course(s) Course(s) Enro No course entered Total course enro //GUI components private Arraylist courselist; private VBox checkboxContainer; . Label labelleft; Label .labelRight; Label labelsubject; Label llabelCoursenum; Label labelinstructor; Label labelNocourse; //Step 1.1: declare any necessary instance, variables here 1/ //constructor public CoursePane() \{ //step 1.2: initialize instance variables 1/ labelLeft = new Label("Add Course(s)"); labelleft. setTextFill(Color. BLUE); labelleft. setFont(Font. font(null, 14)); labelRight = new Label("Course(s) Enrolled"); labelRight.setTextFill(Color. BLUE); labelRight.setFont(Font. font(null, 14)); //set up the layout. Note: CoursePane is a HBox and contains //leftPane, centerPane and rightPane. Pick proper layout class //and use nested sub-pane if necessary, then add each GUI components //step 1.3: create and set up the layout of the leftPane, leftPane co //and a label show at the bottom 1/ labelSubject = new Label ("Subject "); labelsubject. setFont(Font. font(null, 11)); Label labelCoursenum = new Label("Course Num"); //step 1.4: create and set up the layout of the centerPane which hold //step 1.4: create and set up the layout of the centerPane which holds the two Border centerPane = new Border () ; Button addbtn = new Button("Add " ); Button dropbtn = new Button ( "Drops =" "); Hbox hbow = new Hbox (addbtn, dropbtn ); //step 1.5: create and set up the layout of the rightPane, rightPane contains a //checkboxContainer and a label show at the bottom 1/= Border rightPane = new Border (); Label label Totalcourses = new Label("Total courses enrolled:"); labelTotalcourses.setFont(Font. font(nu11, 11)); //CoursePane is a HBox. Add leftPane, centerPane and rightPane inside Hbox hboxnew = new Hbox(leftPane, centerPane, rightPane); this.setPadding(new Insets (10,10,10,10)); 11+ //Step 3: Register the GUI component with its handler class /lend of constructor //step 2.1: Whenever a new Course is added or one or several courses are dropped/rem //1) clear the original checkboxContainer; //2) create a CheckBox for each Course object inside the courselist, and also add it //3) register the CheckBox with the CheckBoxHlandler. public void updateCheckBoxContainer() \{ checkboxContainer.getChildren().clear(); 1/ \} //Step 2.2: Create a ButtonHandler class private class ButtonHandler implements EventhandlersActionEvent> \{ public void handle(ActionEvent e) \{ 11n try \{ if (//everything is entered correctly and the "Add > " button is pressed \{ /eed to check whether the course already exist inside the courselist or if (//it's a new course ) \{ II else //a duplicated one f //show error message II--- 3 3 //Clear all the text fields and prepare for the next entry; 1/ l---. else if (n=" button is pressed, but one of the text field isempty f 3 else if (//when "Drop Course" button is pushed.) \{ \} else I/ for all other invalid actions, thrown an exception and itwill be caug f 11 3 Add Course(s) Course(s) Enro No course entered Total course enro //GUI components private Arraylist courselist; private VBox checkboxContainer; . Label labelleft; Label .labelRight; Label labelsubject; Label llabelCoursenum; Label labelinstructor; Label labelNocourse; //Step 1.1: declare any necessary instance, variables here 1/ //constructor public CoursePane() \{ //step 1.2: initialize instance variables 1/ labelLeft = new Label("Add Course(s)"); labelleft. setTextFill(Color. BLUE); labelleft. setFont(Font. font(null, 14)); labelRight = new Label("Course(s) Enrolled"); labelRight.setTextFill(Color. BLUE); labelRight.setFont(Font. font(null, 14)); //set up the layout. Note: CoursePane is a HBox and contains //leftPane, centerPane and rightPane. Pick proper layout class //and use nested sub-pane if necessary, then add each GUI components //step 1.3: create and set up the layout of the leftPane, leftPane co //and a label show at the bottom 1/ labelSubject = new Label ("Subject "); labelsubject. setFont(Font. font(null, 11)); Label labelCoursenum = new Label("Course Num"); //step 1.4: create and set up the layout of the centerPane which hold //step 1.4: create and set up the layout of the centerPane which holds the two Border centerPane = new Border () ; Button addbtn = new Button("Add " ); Button dropbtn = new Button ( "Drops =" "); Hbox hbow = new Hbox (addbtn, dropbtn ); //step 1.5: create and set up the layout of the rightPane, rightPane contains a //checkboxContainer and a label show at the bottom 1/= Border rightPane = new Border (); Label label Totalcourses = new Label("Total courses enrolled:"); labelTotalcourses.setFont(Font. font(nu11, 11)); //CoursePane is a HBox. Add leftPane, centerPane and rightPane inside Hbox hboxnew = new Hbox(leftPane, centerPane, rightPane); this.setPadding(new Insets (10,10,10,10)); 11+ //Step 3: Register the GUI component with its handler class /lend of constructor //step 2.1: Whenever a new Course is added or one or several courses are dropped/rem //1) clear the original checkboxContainer; //2) create a CheckBox for each Course object inside the courselist, and also add it //3) register the CheckBox with the CheckBoxHlandler. public void updateCheckBoxContainer() \{ checkboxContainer.getChildren().clear(); 1/ \} //Step 2.2: Create a ButtonHandler class private class ButtonHandler implements EventhandlersActionEvent> \{ public void handle(ActionEvent e) \{ 11n try \{ if (//everything is entered correctly and the "Add > " button is pressed \{ /eed to check whether the course already exist inside the courselist or if (//it's a new course ) \{ II else //a duplicated one f //show error message II--- 3 3 //Clear all the text fields and prepare for the next entry; 1/ l---. else if (n=" button is pressed, but one of the text field isempty f 3 else if (//when "Drop Course" button is pushed.) \{ \} else I/ for all other invalid actions, thrown an exception and itwill be caug f 11 3 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started