Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help me with the project! I need a complete Project in Java. Java Project, Pleas

ID: 3807666 • Letter: H

Question

Help me with the project! I need a complete Project in Java.

Java Project, Please help! Course Management: Let's develop a program to simulate course management at a computer science department Define a superclass called Person to store common properties such as name and id number, and its subclasses Student and Professor for their specific properties. Also define aclass called Course to store information about the course, such as course title, id string (e.g., "CS101'), the instructor, and the list of students (use ArrayLis For Student, we should maintain the list of courses taken (currently and in the past) and their respective letter grades (A, B, C, D or F). It should also provide a method to enroll in a course, a method to print all courses taken and a method to print the average letter grade (A, B, C, D or F). The average letter grade is obtained by assigning values 4, 3, 2, 1, and 0, respectively, for A, B, C, D, and F. Also add a method to compute whether the graduation requirement has been met. A passing grade for each course is C or higher. A student may not retake a course that he/she already passed, but may retake otherwise For Professor we should maintain the courses taught for the current semester. Also provide a method to add a course to teach, and a method to print all courses taught currently For Course, add a method to verify whether the number of enrolled students has reached its predefined c (say 10), and if so, it should stop taking more students for the semester. Also, each course must ensure that only 1 instructor is assigned for the semester. For each of these courses, don't forget to provide basic getters and setters. Assume that a student may take no more than 2 courses per semester and that a professor teaches no more than 1 course per semester. Also, no more than 3 courses per semester are offered by the department. Implement these classes, and write a test program to simulate running courses for 4 semesters and print each student's status afterwards, including each student's name, id, list of courses taken and their respective letter grades, the average letter grade, and eligibility to graduate (yes/no) In each semester, there are two phases: enrollment and grading. In enrollment phase, each student randomly selects a course to take. Note that each student may take multiple courses. Repeat this enrollment process until all classes are full or no more enrollment is possible. In the grading phase, each professor randomly assigns a grade for each student in the course they are teaching. Once the semester is done, the courses are reset. Create 15 students, 10+ courses, and 3+ instructors for the simulation. The minimum requirement for grad uation is to pass at least 8 courses with the grade of C or higher

Explanation / Answer

//courses.Java


import java.util.*;
import java.io.*;
public class Courses implements Serializable
{
    private String coursename;
    private String coursefee;
    private String startdate;
    private int duration;
    
    private Faculty coordinator;
    //private Faculty[] faculty = new Faculty[5];
    private ArrayList<Faculty> faculty = new
    
    private ArrayList<Participants> participant
    //private Participants[] participant = new Participants[5];
    
    Courses(){
        coursename = null;
        coursefee = null;
        startdate = null;
        duration = 0;
        
        coordinator = new Faculty();
        /*for (int i=0;i<5;i++){
faculty[i] = new Faculty();
participant[i] = new Participants();
}*/
    }
    
    public void setcoursename(String name){
        this.coursename = name;
    }
    public void setcoursefee(String fee){
        this.coursefee = fee;
    }
    public void setstartdate(String date){
        this.startdate = date;
    }
    public void setduration(int duration){
        this.duration = duration;
    }
    public void setcoordinator(Faculty coord
        this.coordinator = coord;
    }
    
    public String getcoursename(){
        return this.coursename;
    }
    public String getcoursefee(){
        return this.coursefee;
    }
    public String getstartdate(){
        return this.startdate;
    }
    public int getduration(){
        return this.duration;
    }
    public Faculty getcoordinator(){
        return this.coordinator;
    }
    public ArrayList<Faculty> getfaclist(){
        return this.faculty;//.get(i);//this.faculty[i];
    }
    public ArrayList<Participants> getparticipant
        return this.participant;//.get(i);
    }
    
}
//faculty.Java

* Write a description of class Faculty here.
*
* @author (your name)
* @version (a version number or a date)
*/
import java.io.Serializable;
public class Faculty implements Serializable
{
    private String name;
    private String department;
    private String address;
    private String mobnum;
    private String emailid;
    
    Faculty(){
        name = null;
        department = null;
        address = null;
        address = null;
        mobnum = null;
        emailid = null;
    }
    
    public void setname(String name){
        this.name = name;
    }
    public void setaddress(String address){
        this.address = address;
    }
    public void setmobnum(String mobnum){
        this.mobnum = mobnum;
    }
    public void setdepartment(String dept){
        this.department = dept;
    }
    public void setemailid(String id){
        this.emailid = id;
    }
    public String getname(){
        return this.name;
    }
    public String getaddress(){
        return this.address;
    }
    public String getmobnum(){
        return this.mobnum;
    }
    public String getdepartment(){
        return this.department;
    }
    public String getemailid(){
        return this.emailid;
    }
    
}

//participants.Java******

Write a description of class Participants here.
*
* @author (your name)
* @version (a version number or a date)
*/
import java.io.Serializable;
public class Participants implements Serializable
{
    private String name;
    private String address;
    private String mob_num;
    private String org_name;
    private String email_id;
    
    Participants(){
        name = null;
        address = null;
        mob_num = null;
        org_name = null;
        email_id = null;
    }
    
    public void setname(String name){
        this.name = name;
    }
    public void setaddress(String address){
        this.address = address;
    }
    public void setmobnum(String mobnum){
        this.mob_num = mobnum;
    }
    public void setorgname(String orgname){
        this.org_name = orgname;
    }
    public void setemailid(String id){
        this.email_id = id;
    }
    public String getname(){
        return this.name;
    }
    public String getaddress(){
        return this.address;
    }
    public String getmobnum(){
        return this.mob_num;
    }
    public String getorgname(){
        return this.org_name;
    }
    public String getemailid(){
        return this.email_id;
    }
     }

//in this project one segment is left that is cousewindow.Java( some code is)


public class Coursewindow {
private static ArrayList<Courses> courses
     private static ArrayList<Participants>participants
     private static ArrayList<Faculty> faculty
    
private JFrame firstframe;

private JRadioButton btncoursecreate;
private JRadioButton btnstudentcreate;
private JRadioButton btnfacultycreate;
private JRadioButton btnedit;// = new JRadioButton("Edit information",false);
private JRadioButton btndelete;// = new JRadioButton("Delete information",false);
private JRadioButton btndisplay;// = new JRadioButton("Display details",false);
private JFrame createcourseframe;
private JPanel coursepanel;
private JTextArea tcoursename;
private JTextArea tcoursefee;
private JTextArea tcourseduration;
private JTextArea tcoursedate;
private JButton okbutton;
private JFrame createstudentframe;
private JPanel studentpanel;
private JRadioButton btncreatenewstudent;
private JRadioButton btnregisterstudent;
private JFrame newstudentframe;
private JPanel newstudentpanel;
private JTextArea tstudname;
private JTextArea tstudaddress;
private JTextArea tstudemailid;
private JTextArea tstudorgname;
private JTextArea tstudmobnum;
private JButton createbutton;
private JFrame registerstudentframe;
private JPanel registerstudentpanel;
private JComboBox studentnames;
private JComboBox courselist;
private JButton regbutton;
private JFrame createfacframe;
private JPanel facpanel;
private JRadioButton btncreatefaculty;
private JRadioButton btnaddfac;
private JRadioButton btnaddcoord;
private JFrame newfacframe;
private JPanel newfacpanel;
private JTextArea tfacname;
private JTextArea tfacaddress;
private JTextArea tfacemailid;
private JTextArea tfacdept;
private JTextArea tfacmobnum;
private JButton createfacbutton;
private JFrame factocourseframe;
private JPanel factocoursepanel;
private JComboBox cbfacnames;
private JComboBox faccourselist;
private JButton addbutton;
private JFrame coordtocourseframe;
private JPanel coordtocoursepanel;
private JComboBox coordfacnames;
private JComboBox coordcourselist;
private JButton addcoordbutton;
private JFrame frmDisplaydetails;
private JTabbedPane tabDisplaydetails;
private JPanel panelDisplaycoursedetails;
private JPanel panelDisplayparti;
private JPanel panelDisplayfaculty;
private JFrame frmEditdetails;
private JTabbedPane tabEditdetails;
private JPanel panelEditcoursedetails;
private JPanel panelEditparti;
private JPanel panelEditfaculty;
private JComboBox cbchoosecourse;
private JComboBox cbchoosestudent;
private JComboBox cbchoosefaculty;
private JFrame frmDeletedetails;
private JTable editcoursedetails;
/**
* Launch the application.
*/
public static void main(String[] args
EventQueue.invokeLater(new Runnable
public void run() {
try {
Coursewindow
window
readfromfile();
} catch (Exception
e.printStackTrace();
}
}
});
}
public static void readfromfile(){
File file = new File("save.ser
try{
if (!file.exists()){//if file did not exist create new file
file.createNewFile();
}
else{//else read from already existing file
try{
FileInputStream fout
ObjectInputStream
try{
//FileInputStream fout = new FileInputStream(file);
//ObjectInputStream oos = new ObjectInputStream(fout);
courses = (ArrayList<
participants
faculty = (ArrayList<
// System.out.println("Finished Reading! ");
}
catch(Exception e){
JOptionPane.
//e.printStackTrace();
}finally{
try{
if (oos
oos.
fout
}
}catch(IOException
JOptionPane
//e.printStackTrace();
}
}
}catch(FileNotFoundException
JOptionPane.
//e.printStackTrace();
}catch(IOException e){
JOptionPane.
//e.printStackTrace();
}
}
}
catch(IOException e){
JOptionPane.showMessageDialog(
//e.printStackTrace();
}
public void writeTofile(){
FileOutputStream fout = null
        ObjectOutputStream oos = null;
        try{
            fout = new FileOutputStream("save.ser
            oos = new ObjectOutputStream(fout);
            oos.writeObject(courses);
            oos.writeObject(participants);
            oos.writeObject(faculty);
        }catch(Exception e){
            e.printStackTrace();
        }finally{
            try{
                if (oos != null){
                    oos.close();
                    fout.close();
                }
            }catch(Exception e){
                e.printStackTrace();
            }
        }
        //written to file
        
}
/**
* Create the application.
*/
public Coursewindow() {
initialize();
}
public void init_frame(){
firstframe = new JFrame();
firstframe.setFont(new Font(
firstframe.setTitle("COURSE PAGE
firstframe.setForeground(UIManager
//firstframe.setForeground(Color.YELLOW);
//firstframe.setBounds(100, 100, 200, 150);
firstframe.setSize(new Dimension
firstframe.setResizable(false
firstframe.setLocationRelativeTo(
firstframe.setDefaultCloseOperation(
}

public void init_options(){
JPanel firstpanel = new JPanel
//firstpanel.setBackground(Color.BLUE);
JRadioButton btnExtra = new
btncoursecreate = new JRadioButton
btnstudentcreate = new JRadioButton
btnfacultycreate = new JRadioButton
btnedit = new JRadioButton(
btndelete = new JRadioButton
btndisplay = new JRadioButton
//JRadioButton btnexit = new JRadioButton("Delete a casual acquaintance's contact",false);

btncoursecreate.addActionListener(secondwindow);
btnstudentcreate.addActionListener(secondwindow);
btnfacultycreate.addActionListener(secondwindow);
btnedit.addActionListener(secondwindow);
btndelete.addActionListener(secondwindow);
btndisplay.addActionListener(secondwindow);
ButtonGroup group = new ButtonGroup
group.add(btnExtra);
group.add(btncoursecreate);
group.add(btnstudentcreate);
group.add(btnfacultycreate);
group.add(btnedit);
group.add(btndelete);
group.add(btndisplay);

firstpanel.setLayout(new BoxLayout
firstpanel.add(Box.createRigidArea(
firstpanel.add(btnExtra);
firstpanel.add(Box.createVerticalGlue());
firstpanel.add(btncoursecreate);
firstpanel.add(Box.createVerticalGlue());
firstpanel.add(btnstudentcreate);
firstpanel.add(Box.createVerticalGlue());
firstpanel.add(btnfacultycreate);
firstpanel.add(Box.createVerticalGlue());
firstpanel.add(btnedit);
firstpanel.add(Box.createVerticalGlue());
firstpanel.add(btndelete);
firstpanel.add(Box.createVerticalGlue());
firstpanel.add(btndisplay);
firstpanel.add(Box.createVerticalGlue());
firstframe.add(firstpanel);
firstframe.setVisible(true);
}
ActionListener secondwindow = newActionListener
public void actionPerformed(
// TODO Auto-generated method stub
if (e.getSource().equals(btncoursecreate)){
create_course();
//System.out.println("here");
}
else if (e.getSource()
create_student();
}
else if (e.getSource()
create_faculty();
}
else if (e.getSource()
edit_window();
}
else if (e.getSource()
delete_window();
}
else if (e.getSource()
display();
}
}
};
public void create_course(){
//try{
createcourseframe = new JFrame
createcourseframe.setBackground(
createcourseframe.setFont(new
createcourseframe.setTitle("
createcourseframe.setDefaultCloseOperation(
//frmAddContact.setBounds(100, 100, 200, 150);//??
createcourseframe.setSize(new
createcourseframe.setLocationRelativeTo(
coursepanel = new JPanel();
coursepanel.setLayout(new BoxLayout
coursepanel.setAlignmentX(coursepanel
JLabel coursename = new JLabel
coursename.setAlignmentX(coursename
JLabel coursefee = new JLabel
coursefee.setAlignmentX(coursefee
JLabel courseduration = new
courseduration.setAlignmentX(
JLabel coursestart = new JLabel
coursestart.setAlignmentX(coursestart
//try{
tcoursename = new JTextArea();
tcoursename.setFont(new Font
tcoursename.setLineWrap(true
tcoursename.setWrapStyleWord(
tcoursename.setAlignmentX(tcoursename
JScrollPane tcoursenamescrollPane
tcoursenamescrollPane.setPreferredSize(
tcoursefee = new JTextArea();
tcoursefee.setFont(new Font(
tcoursefee.setLineWrap(true);
tcoursefee.setWrapStyleWord(
tcoursefee.setAlignmentX(tcoursefee
JScrollPane tcoursefeescrollPane
tcoursefeescrollPane.setPreferredSize(
tcourseduration = new JTextArea
tcourseduration.setFont(new
tcourseduration.setLineWrap(
tcourseduration.setWrapStyleWord(
tcourseduration.setAlignmentX(
JScrollPane tcoursedurationscrollPane
tcoursedurationscrollPane.setPreferredSize(
tcoursedate = new JTextArea();
tcoursedate.setFont(new Font
tcoursedate.setLineWrap(true
tcoursedate.setWrapStyleWord(
tcoursedate.setAlignmentX(tcoursedate
JScrollPane tcoursedatescrollPane
tcoursedatescrollPane.setPreferredSize(

okbutton = new JButton("CREATE COURSE
okbutton.setAlignmentX(okbutton
okbutton.addActionListener(new
//@Override
private boolean intflag
public void actionPerformed
// TODO Auto-generated method stub
try{
try{
if (
intflag
}
}catch(Exception
JOptionPane
}
try{
Date
                 //while (true){
try {
date
} catch
}
                
                //mycal.setTime(date);
                 LocalDate localDate
                 LocalDate compare = localDate
                 DateTimeFormatter formatter
                 Date newdate = new Date
try {
newdate
} catch
}//one year before now
           
            
                 if ( newdate.before(date)){
                 JOptionPane.
     dateflag = true;
                 //System.out.println("This course is more than a year old.However it is being added to the database. But it won't be displayed for current courses.");
                 }
                
                                
            

}catch(Exception
dateflag
}
if (intflag
createcourse();
writeTofile();
JOptionPane
}

}catch(Exception
}
});
coursepanel.add(Box.createRigidArea(
coursepanel.add(coursename);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
coursepanel.add(tcoursename);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
coursepanel.add(coursefee);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
coursepanel.add(tcoursefee);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
coursepanel.add(courseduration);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
coursepanel.add(tcourseduration);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
coursepanel.add(coursestart);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
coursepanel.add(tcoursedate);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
coursepanel.add(okbutton);
coursepanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
/*}catch(Exception e){
System.out.println("Frame error");
}*/
createcourseframe.add(coursepanel);
createcourseframe.setVisible(
}

public void createcourse(){
Courses newcourse = new Courses
newcourse.setcoursename(tcoursename
newcourse.setcoursefee(tcoursefee
newcourse.setduration(Integer
newcourse.setstartdate(tcoursedate
courses.add(newcourse);
}
public void create_student(){
createstudentframe = new JFrame
createstudentframe.setBackground(
createstudentframe.setFont(new
createstudentframe.setTitle(
createstudentframe.setDefaultCloseOperation(
//frmAddContact.setBounds(100, 100, 200, 150);//??
createstudentframe.setSize(new
createstudentframe.setLocationRelativeTo(
studentpanel = new JPanel();
studentpanel.setLayout(new BoxLayout
studentpanel.setAlignmentX(studentpanel
btncreatenewstudent = new JRadioButton
btnregisterstudent = new JRadioButton
btncreatenewstudent.addActionListener(partilistener);
btnregisterstudent.addActionListener(partilistener);
ButtonGroup group = new ButtonGroup
group.add(btncreatenewstudent);
group.add(btnregisterstudent);
studentpanel.add(Box.createRigidArea(
studentpanel.add(btncreatenewstudent);
studentpanel.add(Box.createRigidArea(
studentpanel.add(btnregisterstudent);
studentpanel.add(Box.createRigidArea(
createstudentframe.add(studentpanel);
//createstudentframe.pack();
createstudentframe.setVisible(
}
ActionListener partilistener = newActionListener
@Override
public void actionPerformed(
// TODO Auto-generated method stub
if (e.getSource().equals(btncreatenewstudent)){
create_student_profile();
}
else if (e.getSource()
register_student();
}
}
};
public void create_student_profile(){
newstudentframe = new JFrame
newstudentframe.setBackground(
newstudentframe.setFont(new
newstudentframe.setTitle("PARTICIPANT'S DETAILS
newstudentframe.setDefaultCloseOperation(
//frmAddContact.setBounds(100, 100, 200, 150);//??
newstudentframe.setSize(new
newstudentframe.setLocationRelativeTo(
newstudentpanel = new JPanel
newstudentpanel.setLayout(new
newstudentpanel.setAlignmentX(
JLabel studname = new JLabel
studname.setAlignmentX(studname
JLabel studaddress = new JLabel
studaddress.setAlignmentX(studaddress
JLabel studmobnum = new JLabel
studmobnum.setAlignmentX(studmobnum
JLabel studemailid = new JLabel
studemailid.setAlignmentX(studemailid
JLabel studorgname = new JLabel
studorgname.setAlignmentX(studorgname
tstudname = new JTextArea();
tstudname.setFont(new Font("
tstudname.setLineWrap(true);
tstudname.setWrapStyleWord(true
tstudname.setAlignmentX(tstudname
JScrollPane tstudnamescrollPane
tstudnamescrollPane.setPreferredSize(
tstudaddress = new JTextArea
tstudaddress.setFont(new Font
tstudaddress.setLineWrap(true
tstudaddress.setWrapStyleWord(
tstudaddress.setAlignmentX(tstudaddress
JScrollPane tstudaddressscrollPane
tstudaddressscrollPane.setPreferredSize(
tstudemailid = new JTextArea
tstudemailid.setFont(new Font
tstudemailid.setLineWrap(true
tstudemailid.setWrapStyleWord(
tstudemailid.setAlignmentX(tstudemailid
JScrollPane tstudemailidscrollPane
tstudemailidscrollPane.setPreferredSize(
tstudmobnum = new JTextArea();
tstudmobnum.setFont(new Font
tstudmobnum.setLineWrap(true
tstudmobnum.setWrapStyleWord(
tstudmobnum.setAlignmentX(tstudmobnum
JScrollPane tstudmobnumscrollPane
tstudmobnumscrollPane.setPreferredSize(
tstudorgname = new JTextArea
tstudorgname.setFont(new Font
tstudorgname.setLineWrap(true
tstudorgname.setWrapStyleWord(
tstudorgname.setAlignmentX(tstudorgname
JScrollPane tstudorgnamescrollPane
tstudorgnamescrollPane.setPreferredSize(
createbutton = new JButton("
createbutton.setAlignmentX(createbutton
createbutton.addActionListener(
@Override
public void actionPerformed
// TODO Auto-generated method stub
try{
Participants
                    newparticipant.setname(tstudname
                    newparticipant.setaddress(tstudaddress
                    newparticipant.setmobnum(tstudmobnum
                    newparticipant.setorgname(tstudorgname
                    newparticipant.setemailid(tstudemailid
                    
                    participants.add(newparticipant);
                    writeTofile();
                    JOptionPane.showMessageDialog(
}catch(Exception
}
});
newstudentpanel.add(Box.createRigidArea(
newstudentpanel.add(studname);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(tstudname);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(studaddress);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(tstudaddress);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(studmobnum);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(tstudmobnum);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(studemailid);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(tstudemailid);
newstudentpanel.add(Box.createRigidArea(
newstudentpanel.add(studorgname);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(tstudorgname);
newstudentpanel.add(Box.createRigidArea(

//coursepanel.add(Box.createVerticalGlue());
newstudentpanel.add(createbutton);
newstudentpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
/*}catch(Exception e){
System.out.println("Frame error");
}*/
newstudentframe.add(newstudentpanel);
newstudentframe.setVisible(true

}

public void register_student(){
registerstudentframe = new JFrame
registerstudentframe.setBackground(
registerstudentframe.setFont(
registerstudentframe.setTitle(
registerstudentframe.setDefaultCloseOperation(
//frmAddContact.setBounds(100, 100, 200, 150);//??
registerstudentframe.setSize(
registerstudentframe.setLocationRelativeTo(
registerstudentpanel = new JPanel
registerstudentpanel.setLayout(
registerstudentpanel.setAlignmentX(
JLabel selectcourse = new JLabel
selectcourse.setAlignmentX(selectcourse
JLabel selectstud = new JLabel
selectstud.setAlignmentX(selectstud
ArrayList<String> studnames
ListIterator<Participants> parti
while (parti.hasNext()){
studnames.add(parti.
}
Collections.sort(studnames);
String[] temp = new String[studnames
temp = studnames.toArray(temp);
studentnames = new JComboBox<
studentnames.setPreferredSize(
studentnames.setAlignmentX(studentnames

ArrayList<String> coursenames
ListIterator<Courses> cit = courses
while (cit.hasNext()){
coursenames.add(cit.
}
Collections.sort(coursenames);
String[] coursetemp = new String
coursetemp =coursenames.toArray(coursetemp);
courselist = new JComboBox<String
courselist.setPreferredSize(
courselist.setAlignmentX(courselist
regbutton = new JButton("REGISTER
regbutton.setAlignmentX(regbutton
regbutton.addActionListener(regparti);
registerstudentpanel.add(Box
registerstudentpanel.add(selectstud);
registerstudentpanel.add(Box
registerstudentpanel.add(studentnames);
registerstudentpanel.add(Box
registerstudentpanel.add(selectcourse);
registerstudentpanel.add(Box
registerstudentpanel.add(courselist);
registerstudentpanel.add(Box
registerstudentpanel.add(regbutton);
registerstudentpanel.add(Box
registerstudentframe.add(registerstudentpanel);
//registerstudentframe.pack();
registerstudentframe.setVisible(
}
ActionListener regparti = new ActionListener
@Override
public void actionPerformed(
// TODO Auto-generated method stub
String studname = (String
String coursename = (
ListIterator<Courses
Courses tempcourse =
while (courseit.hasNext()){
Courses nextobj
if (nextobj.
if (nextobj
break;
}else
nextobj
writeTofile();
}
}
}
break
}
}
}
};
public void create_faculty(){

createfacframe = new JFrame();
createfacframe.setBackground(
createfacframe.setFont(new Font
createfacframe.setTitle("ADD NEW FACULTY TO THE LIST
createfacframe.setDefaultCloseOperation(
//frmAddContact.setBounds(100, 100, 200, 150);//??
createfacframe.setSize(new Dimension
createfacframe.setLocationRelativeTo(
facpanel = new JPanel();
facpanel.setLayout(new BoxLayout
facpanel.setAlignmentX(facpanel
btncreatefaculty = new JRadioButton
btnaddfac = new JRadioButton
btnaddcoord = new JRadioButton
btncreatefaculty.addActionListener(faclistener);
btnaddfac.addActionListener(faclistener);
btnaddcoord.addActionListener(faclistener);
ButtonGroup group = new ButtonGroup
group.add(btncreatefaculty);
group.add(btnaddfac);
group.add(btnaddcoord);
facpanel.add(Box.createRigidArea(
facpanel.add(btncreatefaculty);
facpanel.add(Box.createRigidArea(
facpanel.add(btnaddfac);
facpanel.add(Box.createRigidArea(
facpanel.add(btnaddcoord);
facpanel.add(Box.createRigidArea(
createfacframe.add(facpanel);
//createstudentframe.pack();
createfacframe.setVisible(true

}
ActionListener faclistener = new ActionListener
@Override
public void actionPerformed(
// TODO Auto-generated method stub
if (e.getSource().equals(btncreatefaculty)){
add_faculty_profile();
}
else if (e.getSource()
add_faculty_to_course();
}
else if (e.getSource()
add_course_coordinator();
}
}
};
public void add_faculty_profile(){
newfacframe = new JFrame();
newfacframe.setBackground(Color
newfacframe.setFont(new Font
newfacframe.setTitle("FACULTY'S DETAILS
newfacframe.setDefaultCloseOperation(
//frmAddContact.setBounds(100, 100, 200, 150);//??
newfacframe.setSize(new Dimension
newfacframe.setLocationRelativeTo(
newfacpanel = new JPanel();
newfacpanel.setLayout(new BoxLayout
newfacpanel.setAlignmentX(newfacpanel
JLabel facname = new JLabel(
facname.setAlignmentX(facname
JLabel facaddress = new JLabel
facaddress.setAlignmentX(facaddress
JLabel facmobnum = new JLabel
facmobnum.setAlignmentX(facmobnum
JLabel facemailid = new JLabel
facemailid.setAlignmentX(facemailid
JLabel facdept = new JLabel(
facdept.setAlignmentX(facdept
tfacname = new JTextArea();
tfacname.setFont(new Font("Serif
tfacname.setLineWrap(true);
tfacname.setWrapStyleWord(true
tfacname.setAlignmentX(tfacname
JScrollPane tfacnamescrollPane
tfacnamescrollPane.setPreferredSize(
tfacaddress = new JTextArea();
tfacaddress.setFont(new Font
tfacaddress.setLineWrap(true
tfacaddress.setWrapStyleWord(
tfacaddress.setAlignmentX(tfacaddress
JScrollPane tfacaddressscrollPane
tfacaddressscrollPane.setPreferredSize(
tfacemailid = new JTextArea();
tfacemailid.setFont(new Font
tfacemailid.setLineWrap(true
tfacemailid.setWrapStyleWord(
tfacemailid.setAlignmentX(tfacemailid
JScrollPane tfacemailidscrollPane
tfacemailidscrollPane.setPreferredSize(
tfacmobnum = new JTextArea();
tfacmobnum.setFont(new Font(
tfacmobnum.setLineWrap(true);
tfacmobnum.setWrapStyleWord(
tfacmobnum.setAlignmentX(tfacmobnum
JScrollPane tfacmobnumscrollPane
tfacmobnumscrollPane.setPreferredSize(
tfacdept = new JTextArea();
tfacdept.setFont(new Font("Serif
tfacdept.setLineWrap(true);
tfacdept.setWrapStyleWord(true
tfacdept.setAlignmentX(tfacdept
JScrollPane tfacdeptscrollPane
tfacdeptscrollPane.setPreferredSize(
createfacbutton = new JButton
createfacbutton.setAlignmentX(
createfacbutton.addActionListener(
@Override
public void actionPerformed
// TODO Auto-generated method stub
try{
Faculty
                    newfaculty.setname(tfacname
                    newfaculty.setdepartment(tfacdept
                    newfaculty.setaddress(tfacaddress
                    newfaculty.setmobnum(tfacmobnum
                    newfaculty.setemailid(tfacemailid
                    
                    faculty.add(newfaculty);
                    writeTofile();
                    JOptionPane.showMessageDialog(

}


catch(Exception
}
});
newfacpanel.add(Box.createRigidArea(
newfacpanel.add(facname);//,newstudentpanel.setAlignmentX(newstudentpanel.CENTER_ALIGNMENT););
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(tfacname);
newfacpanel.add(Box.createRigidArea(
newfacpanel.add(facdept);
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(tfacdept);
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(facaddress);
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(tfacaddress);
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(facmobnum);
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(tfacmobnum);
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(facemailid);
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(tfacemailid);
newfacpanel.add(Box.createRigidArea(

//coursepanel.add(Box.createVerticalGlue());
newfacpanel.add(createfacbutton);
newfacpanel.add(Box.createRigidArea(
//coursepanel.add(Box.createVerticalGlue());
/*}catch(Exception e){
System.out.println("Frame error");
}*/
newfacframe.add(newfacpanel);
newfacframe.setVisible(true);

}
public void add_faculty_to_course(){
/*private JFrame factocourseframe;
private JPanel factocoursepanel;
private JComboBox cbfacnames;
private JComboBox faccourselist;
private JButton addbutton;*/
factocourseframe = new JFrame
factocourseframe.setBackground(
factocourseframe.setFont(new
factocourseframe.setTitle("SET FACULTY FOR COURSE
factocourseframe.setDefaultCloseOperation(
//frmAddContact.setBounds(100, 100, 200, 150);//??
factocourseframe.setSize(new
factocourseframe.setLocationRelativeTo(
factocoursepanel = new JPanel
factocoursepanel.setLayout(new
factocoursepanel.setAlignmentX(
JLabel selectcourse = new JLabel
selectcourse.setAlignmentX(selectcourse
JLabel selectfac = new JLabel
selectfac.setAlignmentX(selectfac
ArrayList<String> facnames =
ListIterator<Faculty> facit
while (facit.hasNext()){
facnames.add(facit.next()
}
Collections.sort(facnames);
String[] temp = new String[facnames
temp = facnames.toArray(temp);
cbfacnames = new JComboBox<String
cbfacnames.setPreferredSize(
cbfacnames.setAlignmentX(cbfacnames

ArrayList<String> coursenames
ListIterator<Courses> cit = courses
while (cit.hasNext()){
coursenames.add(cit.
}
Collections.sort(coursenames);
String[] coursetemp = new String
coursetemp =coursenames.toArray(coursetemp);
faccourselist = new JComboBox<
faccourselist.setPreferredSize(
faccourselist.setAlignmentX(
addbutton = new JButton("SET
addbutton.setAlignmentX(addbutton
addbutton.addActionListener(addfaculty);
factocoursepanel.add(Box.createRigidArea(
factocoursepanel.add(selectfac);
factocoursepanel.add(Box.createRigidArea(
factocoursepanel.add(cbfacnames);
factocoursepanel.add(Box.createRigidArea(
factocoursepanel.add(selectcourse);
factocoursepanel.add(Box.createRigidArea(
factocoursepanel.add(faccourselist);
factocoursepanel.add(Box.createRigidArea(
factocoursepanel.add(addbutton);
factocoursepanel.add(Box.createRigidArea(
factocourseframe.add(factocoursepanel);
//registerstudentframe.pack();
factocourseframe.setVisible(
}
ActionListener addfaculty = new ActionListener
public void actionPerformed(
// TODO Auto-generated method stub
String facname = (String
String coursename = (
ListIterator<Courses
Courses tempcourse =
while (courseit.hasNext()){
Courses nextobj
if (nextobj.
if (nextobj
break;
}else
nextobj
writeTofile();
}
}
}
break
}
}
}
};


tabEditdetails.addTab("COURSE PARTICIPANTS
tabEditdetails.addTab("COURSE FACULTY

frmEditdetails.add(tabEditdetails);
//frmDisplayContact.setLayout(new BorderLayout());
frmEditdetails.setVisible(true

}
public void edit_course_details_tab(){
panelEditcoursedetails = new
panelEditcoursedetails.setLayout(
cbchoosecourse = new JComboBox
ArrayList<String> coursenames
ListIterator<Courses> cit = courses
while (cit.hasNext()){
coursenames.add(cit.
}
Collections.sort(coursenames);
String[] coursetemp = new String
coursetemp =coursenames.toArray(coursetemp);
cbchoosecourse = new JComboBox<
cbchoosecourse.setPreferredSize(
cbchoosecourse.setAlignmentX(
JRadioButton btn1 = new JRadioButton
JRadioButton btn2 = new JRadioButton
JRadioButton btn3 = new JRadioButton
JRadioButton btn4 = new JRadioButton
JRadioButton btn5 = new JRadioButton
JRadioButton btn6 = new JRadioButton
JRadioButton btn7 = new JRadioButton

ButtonGroup group = new ButtonGroup
group.add(btn7);
group.add(btn6);
group.add(btn5);
group.add(btn4);
group.add(btn3);
group.add(btn2);
group.add(btn1);

btn1.addActionListener(new ActionListene

public void actionPerformed
// TODO Auto-generated method stub
String coursename
ListIterator<
while (courseit
Courses
if (temp
temp
writeTofile();
}
}
}
}
});

//remaining 4 button code left
panelEditparti.add(Box.createRigidArea(
panelEditparti.add(cbchoosestudent);
panelEditparti.add(Box.createRigidArea(
panelEditparti.add(btn1);
panelEditparti.add(Box.createRigidArea(
panelEditparti.add(btn2);
panelEditparti.add(Box.createRigidArea(
panelEditparti.add(btn3);
panelEditparti.add(Box.createRigidArea(
panelEditparti.add(btn4);
panelEditparti.add(Box.createRigidArea(
panelEditparti.add(btn5);
panelEditparti.add(Box.createRigidArea(
panelEditparti.setPreferredSize(
}
public void edit_faculty_tab(){
panelEditfaculty = new JPanel
panelEditfaculty.setLayout(new
ArrayList<String> facnames =
ListIterator<Faculty> facit
while (facit.hasNext()){
facnames.add(facit.next()
}
Collections.sort(facnames);
String[] temp = new String[facnames
temp = facnames.toArray(temp);
cbchoosefaculty = new JComboBox<
cbchoosefaculty.setPreferredSize(
cbchoosefaculty.setAlignmentX(
JRadioButton btn1 = new JRadioButton
JRadioButton btn2 = new JRadioButton
JRadioButton btn4 = new JRadioButton
JRadioButton btn5 = new JRadioButton
JRadioButton btn3 = new JRadioButton
ButtonGroup group = new ButtonGroup
group.add(btn5);
group.add(btn4);
group.add(btn3);
group.add(btn2);
group.add(btn1);
btn1.addActionListener(new ActionListener
@Override
public void actionPerformed
// TODO Auto-generated method stub
String facname
ListIterator<
while (it.hasNext()){
Faculty
if (temp
temp
writeTofile();
}
}
}
}
});again 4 button code left


panelEditfaculty.add(Box.createRigidArea(
panelEditfaculty.add(cbchoosefaculty);
panelEditfaculty.add(Box.createRigidArea(
panelEditfaculty.add(btn1);
panelEditfaculty.add(Box.createRigidArea(
panelEditfaculty.add(btn2);
panelEditfaculty.add(Box.createRigidArea(
panelEditfaculty.add(btn3);
panelEditfaculty.add(Box.createRigidArea(
panelEditfaculty.add(btn4);
panelEditfaculty.add(Box.createRigidArea(
panelEditfaculty.add(btn5);
panelEditfaculty.add(Box.createRigidArea(
panelEditfaculty.setPreferredSize(

}
public void delete_window(){
frmDeletedetails = new JFrame
frmDeletedetails.setBackground(
frmDeletedetails.setFont(new
frmDeletedetails.setTitle("Delete Details
frmDeletedetails.setDefaultCloseOperation(
//frmAdddetails.setBounds(100, 100, 200, 150);//??
frmDeletedetails.setSize(new
frmDeletedetails.setLocationRelativeTo(
JPanel deletepanel = new JPanel
deletepanel.setLayout(new BoxLayout
JRadioButton btn1 = new JRadioButton
JRadioButton btn2 = new JRadioButton
JRadioButton btn3 = new JRadioButton
ButtonGroup group = new ButtonGroup
group.add(btn1);
group.add(btn2);
group.add(btn3);
btn1.addActionListener(new ActionListener
@Override
public void actionPerformed
// TODO Auto-generated method stub
String coursename
ListIterator<
                
                while (it.hasNext()){
                    Courses nextcourse = it.
                    if (nextcourse.getcoursename()
                        courses.remove(nextcourse);
                        JOptionPane.showMessageDialog(
                        writeTofile();
                        break;
                    }
                    if (! it.hasNext()){
                     JOptionPane.showMessageDialog(
                        
  
/ oursedetails =


String[] columns = {"Name","
Object[][] rows = new Object
for (Courses i:courses){
Date date = new Date
try {
date = new SimpleDateFormat
} catch (ParseException
// TODO Auto-generated catch block
//e.printStackTrace();
JOptionPane.
}
            //mycal.setTime(date);
            LocalDate localDate = LocalDate.
            LocalDate compare =localDate.minusYears(
            DateTimeFormatter formatter =DateTimeFormatter
            Date newdate = new Date();
try {
newdate = new
} catch (ParseException
// TODO Auto-generated catch block
//e.printStackTrace();
}
       
       /
dispcoursedetails.setAutoResizeMode(
dispcoursedetails.setAutoCreateColumnsFromModel(
panelDisplaycoursedetails.setLayout(
panelDisplaycoursedetails.add(
panelDisplaycoursedetails.setPreferredSize(
}

disppartidetails.setAutoResizeMode(
//disppartidetails.setAutoCreateColumnsFromModel(true);
dispcoursepartipanel.setLayout(
dispcoursepartipanel.add(new
dispcoursepartipanel.setPreferredSize(

dispcoursepartiframe.add(dispcoursepartipanel);
dispcoursepartiframe.setVisible(

}
public void disp_faculty_tab(){
panelDisplayfaculty = new JPanel
panelDisplayfaculty.setLayout(
panelDisplayfaculty.setAlignmentX(
//JComboBox chooseparti = new JComboBox();
ArrayList<String> coursenames
ListIterator<Courses> cit = courses
while (cit.hasNext()){
Courses temp = cit.next();
Date date = new Date
try {
date = new SimpleDateFormat
} catch (ParseException
// TODO Auto-generated catch block
//e.printStackTrace();
JOptionPane.
}
            //mycal.setTime(date);
            LocalDate localDate = LocalDate.
            LocalDate compare =localDate.minusYears(
            DateTimeFormatter formatter =DateTimeFormatter
            Date newdate = new Date();
try {
newdate = new
} catch (ParseException
// TODO Auto-generated catch block
//e.printStackTrace();
}
       
        
            if (newdate.before(date)){//more than a year old course--->don't display
                continue;
            }

coursenames.add(temp
}
Collections.sort(coursenames);
String[] coursetemp = new String
coursetemp =coursenames.toArray(coursetemp);
JComboBox choosecourse = new
choosecourse.setPreferredSize(
choosecourse.setAlignmentX(choosecourse

JButton showfac = new JButton
showfac.setAlignmentX(showfac
showfac.addActionListener(new
@Override
public void actionPerformed
// TODO Auto-generated method stub
String coursename
init_coursefac_table(coursename);
}
});
/*JButton showall = new JButton("Show all participant profiles");
showall.setAlignmentX(showall.CENTER_ALIGNMENT);
showall.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
init_showallparti_table();
}
});*/
JLabel templabel = new JLabel
templabel.setAlignmentX(templabel
panelDisplayfaculty.add(Box.
panelDisplayfaculty.add(templabel);
panelDisplayfaculty.add(Box.
panelDisplayfaculty.add(choosecourse);
panelDisplayfaculty.add(Box.
panelDisplayfaculty.add(showfac);
panelDisplayfaculty.add(Box.
/*panelDisplayparti.add(showall);
panelDisplayparti.add(Box.createVerticalGlue());
*/
}
public void init_coursefac_table(String
JFrame dispcoursefacframe =
dispcoursefacframe.setBackground(
dispcoursefacframe.setFont(new
dispcoursefacframe.setTitle(
dispcoursefacframe.setDefaultCloseOperation(
//frmAddContact.setBounds(100, 100, 200, 150);//??
dispcoursefacframe.setSize(new
dispcoursefacframe.setLocationRelativeTo(
JPanel dispcoursefacpanel =
dispcoursefacpanel.setLayout(
ListIterator<Courses> courseit
while (courseit.hasNext()){
Courses temp = courseit

if (temp.getcoursename()
JLabel coordlabel
coordlabel.setAlignmentX(
if (temp.getcoordinator()
coordlabel
}else{
coordlabel.setText(
}
String[] columns
Object[][] rows
for (Faculty
//rows[relatives.indexOf(i)][0] = new Object();
rows[temp
rows[temp
rows[temp
rows[temp
rows[temp
}
JTable dispfacdetails
public
{
}
public
}
};
dispfacdetails
//disppartidetails.setAutoCreateColumnsFromModel(true);
dispcoursefacpanel
dispcoursefacpanel
dispcoursefacpanel
dispcoursefacpanel
dispcoursefacpanel
dispcoursefacpanel
dispcoursefacpanel
break;
}
}
dispcoursefacframe.add(dispcoursefacpanel);
dispcoursefacframe.setVisible(

}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
/*frame = new JFrame();
frame.getContentPane().setLayout(new BorderLayout());
init_frame();
init_options();
}
}