Gym management doc with code PDF

Title Gym management doc with code
Author Eric Styles
Course Electronic Devices
Institution Riphah International University
Pages 49
File Size 422.7 KB
File Type PDF
Total Downloads 809
Total Views 920

Summary

GYMMANAGEMENT SYSTEMObject OrientedGYMMANAGEMENT SYSTEMObject OrientedGYM MANAGEMENT SYSTEMMODEL CLASSES:package gym;import java.io;public class GymEmployee extends Person implements Serializable{private String EmployeeID; private String EmployeeStatus; public GymEmployee() { super(); }public GymEmp...


Description

Object Oriented

GYM MANAGEMEN T SYSTEM

GYM MANAGEMENT SYSTEM

MODEL CLASSES: package gym; import java.io.Serializable; public class GymEmployee extends Person implements Serializable{ private String EmployeeID; private String EmployeeStatus; public GymEmployee() { super(); } public GymEmployee(String name, int age, String gender, String phone, String email,String EmployeeID,String EmployeeStatus) { super(name, age, gender, phone, email); this.EmployeeID=EmployeeID; this.EmployeeStatus=EmployeeStatus; } public String getEmployeeID() { return EmployeeID; } public void setEmployeeID(String employeeID) { EmployeeID = employeeID; } public String getEmployeeStatus() { return EmployeeStatus; } public void setEmployeeStatus(String employeeStatus) { EmployeeStatus = employeeStatus; } } package gym; import java.io.Serializable; public class Equipment implements Serializable { private String EquipmentName; private String EquipmentDescription; private double SizeOfEquipment;

public Equipment() { // TODO Auto-generated constructor stub } Equipment(String EquipmentName,String EquipmentDescription,double SizeOfEquipment ){ this.EquipmentName=EquipmentName; this.EquipmentDescription=EquipmentDescription; this.SizeOfEquipment=SizeOfEquipment;

} public String getEquipmentName() { return EquipmentName; } public void setEquipmentName(String equipmentName) { EquipmentName = equipmentName; } public String getEquipmentDescription() { return EquipmentDescription; } public void setEquipmentDescription(String equipmentDescription) { EquipmentDescription = equipmentDescription; } public double getSizeOfEquipment() { return SizeOfEquipment; } public void setSizeOfEquipment(double sizeOfEquipment) { SizeOfEquipment = sizeOfEquipment; } } package gym; import java.io.Serializable; public class GymMember extends Person implements Serializable { private double weight; private String memberhipStatus; private String Trainer; public GymMember() { super(); // TODO Auto-generated constructor stub } GymMember(String name, int age, String gender, String phone, String email, double weight, String membershipStatus, String Trainer){ super(name,age,gender,phone,email); this.weight=weight;

this.memberhipStatus=membershipStatus; this.Trainer=Trainer;

} public String getTrainer() { return Trainer; } public void setTrainer(String trainer) { Trainer = trainer; } public double getWeight() { return weight; } public void setWeight(double weight) { this.weight = weight; } public String getMemberhipStatus() { return memberhipStatus; } public void setMemberhipStatus(String memberhipStatus) { this.memberhipStatus = memberhipStatus; } } package gym;import java.io.Serializable; public class GymManagement implements Serializable { private GymMember Memb; private Trainer train; public GymManagement() { super(); } public GymManagement(GymMember memb, Trainer train) { super(); Memb = memb; this.train = train; } public GymMember getMemb() { return Memb; } public void setGymMemb(GymMember memb) { Memb = memb; } public Trainer getTrain() { return train; } public void setTrain(Trainer train) { this.train = train; }

} ……………………………………………………………………………………………

GUI CONTAINING CLASSESS: package gym; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.io.*; import javax.swing.*; import java.util.ArrayList; public class Add extends JFrame { Font italicFont ,BoldFont,plainFont; JLabel L1,L2,L3,L4,L5,L6,L7,L8,L9; JTextField T1,T2,T3,T4,T5,T6,T7,T8,T9; JButton B1,B2; ButtonGroup style, member; JRadioButton S1,S2,plain,italic,bold,bolditalic; private Font bolditalicFont; Add(){ setSize(600,600); setLayout(new GridLayout(15,2)); GridLayout G1=new GridLayout(2,3,10,20 ); L1=new JLabel("ENTER NAME:"); L2=new JLabel("ENTER AGE"); L3=new JLabel("ENTER GENDER:"); L4=new JLabel("ENTER PHONE:"); L5=new JLabel("ENTER EMAIL:"); L7=new JLabel("ENTER WEIGHT:"); L8=new JLabel("ENTER MEMBERSHIP STATUS:"); L9=new JLabel("TRAINER"); T1=new T2=new T3=new T4=new T5=new T6=new T7=new T8=new T9=new

JTextField(10); JTextField(10); JTextField(10); JTextField(10); JTextField(10); JTextField(10); JTextField(10); JTextField(10); JTextField(10);

B1=new JButton("SUBMIT"); B2=new JButton("BACK"); style=new ButtonGroup(); plain=new JRadioButton("Plain",true); bold=new JRadioButton("bold",false); italic=new JRadioButton("Italic",false); bolditalic=new JRadioButton("Bold/Italic",false); T1.setBorder(BorderFactory.createLineBorder(Color.black,2)); T2.setBorder(BorderFactory.createLineBorder(Color.black,2)); T3.setBorder(BorderFactory.createLineBorder(Color.black,2)); T4.setBorder(BorderFactory.createLineBorder(Color.black,2)); T5.setBorder(BorderFactory.createLineBorder(Color.black,2)); T6.setBorder(BorderFactory.createLineBorder(Color.black,2)); T7.setBorder(BorderFactory.createLineBorder(Color.black,2)); T8.setBorder(BorderFactory.createLineBorder(Color.black,2)); T9.setBorder(BorderFactory.createLineBorder(Color.black,2)); B1.setBorder(BorderFactory.createLineBorder(Color.black,2)); T1.setBackground(Color.LIGHT_GRAY); T2.setBackground(Color.LIGHT_GRAY); T3.setBackground(Color.LIGHT_GRAY); T4.setBackground(Color.LIGHT_GRAY); T5.setBackground(Color.LIGHT_GRAY); T6.setBackground(Color.LIGHT_GRAY); T7.setBackground(Color.LIGHT_GRAY); T8.setBackground(Color.LIGHT_GRAY); T9.setBackground(Color.LIGHT_GRAY); G1.setHgap(10); G1.setVgap(10); add(L1); add(T1); add(L2); add(T2); add(L3); add(T3); add(L4); add(T4); add(L5); add(T5); add(L7); add(T7); add(L8); add(T8); add(L9); add(T9); add(plain); add(bold); add(italic); add(bolditalic); style.add(plain); style.add(bold); style.add(italic);

style.add(bolditalic); plainFont= new Font( "Serif", Font.PLAIN, 14 ); BoldFont= new Font( "Serif", Font.BOLD, 14 ); italicFont= new Font( "Serif", Font.ITALIC, 14 ); bolditalicFont= new Font( "Serif", Font.BOLD+Font.ITALIC, 14 ); plain.addItemListener(new RadioButtonHandler( plainFont ) ); bold.addItemListener(new RadioButtonHandler( BoldFont ) ); italic.addItemListener(new RadioButtonHandler( italicFont) ); bolditalic.addItemListener(new RadioButtonHandler( bolditalicFont ) ); MyActionListener A = new MyActionListener(); B1.addActionListener(A); B2.addActionListener(A); add(B1); add(B2); } public class RadioButtonHandler implements ItemListener{ private Font font; public RadioButtonHandler( Font f ) { font=f; } public void itemStateChanged( ItemEvent event ) { T1.setFont(font); T2.setFont(font); T3.setFont(font); T4.setFont(font); T5.setFont(font); T6.setFont(font); T7.setFont(font); T8.setFont(font); T9.setFont(font); } } public class MyActionListener implements ActionListener { public void actionPerformed(ActionEvent ae){ ArrayListTrainerlist=Helper.readAllDataTrainer(); if(ae.getActionCommand().equalsIgnoreCase("SUBMIT")){ for(int i=0;i...


Similar Free PDFs