def changePasswordForm(check): global frame global tfOldPassword global tfNewPassword global tfConfirmPassword global value value = check frame = JFrame("Change Password") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 350) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500, 350) panel.setLocation(0, 0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel("Change Password") heading.setBounds(200, 30, 150, 40) lbOldPassword = JLabel("Old Password") lbNewPassword = JLabel("New Password") lbConfirmPassword = JLabel("Confirm Password") tfOldPassword = JTextField() tfNewPassword = JTextField() tfConfirmPassword = JTextField() lbOldPassword.setBounds(50, 100, 150, 30) lbNewPassword.setBounds(50, 150, 150, 30) lbConfirmPassword.setBounds(50, 200, 150, 30) tfOldPassword.setBounds(220, 100, 150, 30) tfNewPassword.setBounds(220, 150, 150, 30) tfConfirmPassword.setBounds(220, 200, 150, 30) btnSave = JButton("Save", actionPerformed=clickSave) btnCancel = JButton("Cancel", actionPerformed=clickCancel) btnSave.setBounds(350, 280, 100, 30) btnCancel.setBounds(50, 280, 100, 30) panel.add(heading) panel.add(lbOldPassword) panel.add(lbNewPassword) panel.add(lbConfirmPassword) panel.add(tfOldPassword) panel.add(tfNewPassword) panel.add(tfConfirmPassword) panel.add(btnSave) panel.add(btnCancel) frame.add(panel)
def addCourse(): global tfCourseName global tfCourseId global tfCourseFee global frame global btnEnter frame = JFrame("Add Course ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(450, 450) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(450, 450) panel.setLocation(0, 0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel("ADD COURSE") heading.setBounds(200, 30, 150, 40) lbCourseName = JLabel("Course Name ") lbCourseId = JLabel("Course Id") lbCourseFee = JLabel(" Course Fee") tfCourseName = JTextField() tfCourseId = JTextField() tfCourseFee = JTextField() lbCourseName.setBounds(70, 120, 130, 30) lbCourseId.setBounds(70, 170, 130, 30) lbCourseFee.setBounds(70, 220, 130, 30) tfCourseName.setBounds(220, 120, 150, 30) tfCourseId.setBounds(220, 170, 150, 30) tfCourseFee.setBounds(220, 220, 150, 30) btnEnter = JButton("Enter", actionPerformed=clickAddCourseFee) btnEnter.setBounds(300, 300, 100, 40) btnCancel = JButton("Cancel", actionPerformed=clickCancel) btnCancel.setBounds(70, 300, 100, 40) panel.add(heading) panel.add(lbCourseName) panel.add(lbCourseId) panel.add(lbCourseFee) panel.add(tfCourseFee) panel.add(tfCourseName) panel.add(tfCourseId) panel.add(tfCourseFee) panel.add(btnEnter) panel.add(btnCancel) frame.add(panel)
def studentLogined(stObj): global panel global table global heading global frame frame = JFrame("Student Page ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 600) frame.setLocation(200, 200) frame.setLayout(None) panel = JPanel() panel.setSize(500, 580) panel.setLocation(0, 20) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.WHITE) heading = JLabel() heading.setBounds(210, 10, 200, 30) table = JTable() table.setBounds(0, 50, 500, 470) sp = JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS) bar = JMenuBar() profile = JMenu("Profile") showProfile = JMenuItem("Show Profile", actionPerformed=clickShowStudentProfile) changePassword = JMenuItem("Change Password", actionPerformed=changeStudentPassword) profile.add(showProfile) profile.add(changePassword) bar.add(profile) attendence = JMenu("Attendence") showAllAttendence = JMenuItem("Show All Attendence", actionPerformed=clickAllAttendence) showAttendenceInMonth = JMenuItem("show attendence in month", actionPerformed=clickAttendenceInMonth) attendence.add(showAllAttendence) attendence.add(showAttendenceInMonth) bar.add(attendence) logout = JMenuItem("logout", actionPerformed=clickLogout) bar.add(logout) panel.add(table) frame.setJMenuBar(bar) frame.add(panel) frame.setVisible(True)
def getUiComponent(self): panel = JPanel(BorderLayout()) panel.setLocation(100, 100) panel.setLayout(None) lbl1 = JLabel("Insert URL") lbl1.setBounds(60, 20, 100, 40) txt1 = JTextField(100) txt1.setBounds(140, 20, 600, 40) def btn1Click(event): import requests from bs4 import BeautifulSoup url = requests.get("http://" + str(txt1.text)) # a=requests.get(str(txt1.text)) req = url.text links = [] soup = BeautifulSoup(url.text, 'html.parser') for link in soup.find_all('a'): links.append(link.get('href')) links = ((str(links).replace("[", "")).replace("]", "")).replace("u'", "'") txt2.text = links #set info por table2 txt2.editable = False txt2.wrapStyleWord = True txt2.lineWrap = True text2.aligmentx = Component.LEFT_ALIGMENT txt2.size(300, 1) return btn = JButton("Click", actionPerformed=btn1Click) btn.setBounds(400, 80, 60, 30) panel.add(lbl1, BorderLayout.CENTER) panel.add(txt1, BorderLayout.CENTER) panel.add(btn, BorderLayout.CENTER) lbl2 = JLabel("Output URLs") lbl2.setBounds(60, 80, 150, 40) txt2 = JTextArea() txt2.setBounds(140, 120, 600, 600) txt2.setBackground(Color.WHITE) # set table color, if you want panel.add(lbl2, BorderLayout.CENTER) panel.add(txt2, BorderLayout.CENTER) return panel
def showLoginIdPassword(data): global frame frame = JFrame("Show Id Password ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500,350) frame.setLocation(200,200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500,350) panel.setLocation(0,0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel("LoginId AND Password") heading.setBounds(200,30,150,40) lbLoginId = JLabel("LoginId") lbPassword = JLabel("password") tfLoginId = JTextField(data[0].encode('ascii')) tfPassword = JTextField(data[1].encode('ascii')) tfLoginId.setEditable(False) tfPassword.setEditable(False) lbLoginId.setBounds(50,100,150,30) lbPassword.setBounds(50,150,150,30) tfLoginId.setBounds(220,100,150,30) tfPassword.setBounds(220,150,150,30) btnOk = JButton("Ok",actionPerformed=clickOk) btnOk.setBounds(250,220,100,30) panel.add(heading) panel.add(lbLoginId) panel.add(lbPassword) panel.add(tfLoginId) panel.add(tfPassword) panel.add(btnOk) frame.add(panel)
def getCourseName(check): global frame global tfStudentCourseChoice global value value = check frame = JFrame("Course Name ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500,250) frame.setLocation(200,200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500,250) panel.setLocation(0,0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel("Get Course Name") heading.setBounds(200,30,150,40) lbStudentCourseChoice = JLabel("Student course name") tfStudentCourseChoice = JTextField() lbStudentCourseChoice.setBounds(50,70,150,30) tfStudentCourseChoice.setBounds(220,70,150,30) btnEnter = JButton("Enter",actionPerformed=clickStudentCourseChoice) btnCancel = JButton("Cancel",actionPerformed=clickBtnCancel) btnEnter.setBounds(350,150,100,30) btnCancel.setBounds(50,150,100,30) panel.add(heading) panel.add(lbStudentCourseChoice) panel.add(tfStudentCourseChoice) panel.add(btnEnter) panel.add(btnCancel) frame.add(panel)
def showAttendenceSheet(): global table global heading global frame global panel global btnSave global btnCancel frame = JFrame("Teacher Attendence Sheet ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 600) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500, 600) panel.setLocation(0, 0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.WHITE) heading = JLabel() heading.setBounds(200, 10, 150, 30) table = JTable() table.setBounds(0, 50, 500, 450) panel.add(table) btnSave = JButton("Save", actionPerformed=clickSaveBtn) btnCancel = JButton("Cancel", actionPerformed=clickCancelBtn) btnSave.setBounds(350, 540, 100, 40) btnCancel.setBounds(70, 540, 100, 40) panel.add(heading) panel.add(table) panel.add(btnSave) panel.add(btnCancel) frame.add(panel)
def showStudentAttendenceSheetAdminLogined(): global table global heading global frame global panel global btnok frame = JFrame("Student Attendence Sheet ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 600) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500, 600) panel.setLocation(0, 0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.WHITE) heading = JLabel("Student Attendence") heading.setBounds(200, 10, 150, 30) table = JTable() table.setBounds(0, 50, 500, 450) panel.add(table) btnOk = JButton("Ok", actionPerformed=clickOk) btnOk.setBounds(200, 540, 100, 40) panel.add(heading) panel.add(table) panel.add(btnOk) frame.add(panel)
def updateTeacherForm(data): global heading global tfTeacherName global tfTeacherPhone global taTeacherAddress global tfTeacherEmail global tfTeacherCourse global tfTeacherPayment global frame global btnEnter frame = JFrame(" Teacher ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 600) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500, 600) panel.setLocation(0, 0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel(" TEACHER PROFILE") heading.setBounds(200, 30, 150, 40) lbTeacherName = JLabel("Teacher Name ") lbTeacherPhone = JLabel("Phone") lbTeacherEmail = JLabel("Email") lbTeacherAddress = JLabel("Address") lbTeacherCourse = JLabel("Teacher Course ") lbTeacherPayment = JLabel("Teacher Payment") teacherName = data[0].encode('ascii') teacherPhone = data[1].encode('ascii') teacherEmail = data[2].encode('ascii') teacherAddress = data[3].encode('ascii') teacherCourse = data[4].encode('ascii') teacherPayment = data[5] tfTeacherName = JTextField(teacherName) tfTeacherPhone = JTextField(teacherPhone) taTeacherAddress = JTextArea(teacherAddress) tfTeacherEmail = JTextField(teacherEmail) tfTeacherCourse = JTextField(teacherCourse) tfTeacherPayment = JTextField(str(teacherPayment)) tfTeacherCourse.setEditable(False) tfTeacherPayment.setEditable(False) tfTeacherName.setEditable(False) lbTeacherName.setBounds(70, 100, 130, 30) lbTeacherPhone.setBounds(70, 150, 130, 30) lbTeacherEmail.setBounds(70, 200, 130, 30) lbTeacherAddress.setBounds(70, 250, 130, 30) lbTeacherCourse.setBounds(70, 350, 130, 30) lbTeacherPayment.setBounds(70, 400, 130, 30) tfTeacherName.setBounds(220, 100, 130, 30) tfTeacherPhone.setBounds(220, 150, 130, 30) tfTeacherEmail.setBounds(220, 200, 130, 30) taTeacherAddress.setBounds(220, 250, 130, 80) tfTeacherCourse.setBounds(220, 350, 130, 30) tfTeacherPayment.setBounds(220, 400, 130, 30) btnEnter = JButton("Update", actionPerformed=clickUpdateTeacher) btnEnter.setBounds(350, 450, 100, 40) btnCancel = JButton("Cancel", actionPerformed=clickCancel) btnCancel.setBounds(100, 450, 100, 40) panel.add(heading) panel.add(lbTeacherName) panel.add(lbTeacherPhone) panel.add(lbTeacherEmail) panel.add(lbTeacherAddress) panel.add(lbTeacherCourse) panel.add(lbTeacherPayment) panel.add(tfTeacherName) panel.add(tfTeacherPhone) panel.add(tfTeacherEmail) panel.add(taTeacherAddress) panel.add(tfTeacherCourse) panel.add(tfTeacherPayment) panel.add(btnEnter) panel.add(btnCancel) frame.add(panel)
def instReg(): global frame global tfName global tfPhone global taAddress global tfAdminLoginId global tfAdminPassword frame = JFrame("Registration Form ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500,550) frame.setLocation(200,200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500,550) panel.setLocation(0,0) panel.setLayout(None) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel("Institute Registration Form ") heading.setBounds(200,30,150,30) lbName = JLabel("Name") lbPhone =JLabel("Phone no ") lbAddress = JLabel("Address") lbAdminLoginId = JLabel("Admin login ") lbAdminPassword =JLabel("Admin Password") font = Font("Courier",Font.PLAIN,16) tfName = JTextField() tfPhone = JTextField() taAddress =JTextArea() tfAdminLoginId = JTextField() tfAdminPassword = JTextField() lbName.setBounds(70,100,150,40) lbPhone.setBounds(70,150,150,40) lbAddress.setBounds(70,200,150,40) lbAdminLoginId.setBounds(70,310,150,40) lbAdminPassword.setBounds(70,360,150,40) tfName = JTextField() tfPhone = JTextField() taAddress = JTextArea() tfAdminLoginId = JTextField() tfAdminPassword = JTextField() tfName.setBounds(250,100,200,40) tfPhone.setBounds(250,150,200,40) taAddress.setBounds(250,200,200,100) tfAdminLoginId.setBounds(250,310,200,40) tfAdminPassword.setBounds(250,360,200,40) tfName.setFont(font) tfPhone.setFont(font) taAddress.setFont(font) tfAdminLoginId.setFont(font) tfAdminPassword.setFont(font) sp = JScrollPane(taAddress) c = frame.getContentPane() btnSave = JButton("Save",actionPerformed=clickAdminReg) btnSave.setBounds(350,420,80,30) #panel.add(lbName) #panel.add(lbPhone) #panel.add(lbAddress) #panel.add(lbAdminLoginId) #panel.add(lbAdminPassword) #panel.add(tfName) #panel.add(tfPhone) #panel.add(c) #panel.add(tfAdminLoginId) #panel.add(tfAdminPassword) #panel.add(btnSave) #panel.add(btnLogin) c.add(lbName) c.add(lbPhone) c.add(lbAddress) c.add(lbAdminLoginId) c.add(lbAdminPassword) c.add(tfName) c.add(tfPhone) c.add(taAddress) c.add(tfAdminLoginId) c.add(tfAdminPassword) c.add(btnSave) frame.add(c)
def addTeacher(): global heading global tfTeacherName global tfTeacherPhone global taTeacherAddress global tfTeacherEmail global tfTeacherCourse global tfTeacherPayment global frame global btnEnter frame = JFrame("Add Teacher ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 600) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500, 600) panel.setLocation(0, 0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel("ADD TEACHER") heading.setBounds(200, 30, 150, 40) lbTeacherName = JLabel("Teacher Name ") lbTeacherPhone = JLabel("Phone") lbTeacherEmail = JLabel("Email") lbTeacherAddress = JLabel("Address") lbTeacherCourse = JLabel("Teacher Course ") lbTeacherPayment = JLabel("Teacher Payment") tfTeacherName = JTextField() tfTeacherPhone = JTextField() taTeacherAddress = JTextArea() tfTeacherEmail = JTextField() tfTeacherCourse = JTextField() tfTeacherPayment = JTextField() lbTeacherName.setBounds(70, 100, 130, 30) lbTeacherPhone.setBounds(70, 150, 130, 30) lbTeacherEmail.setBounds(70, 200, 130, 30) lbTeacherAddress.setBounds(70, 250, 130, 30) lbTeacherCourse.setBounds(70, 350, 130, 30) lbTeacherPayment.setBounds(70, 400, 130, 30) tfTeacherName.setBounds(220, 100, 130, 30) tfTeacherPhone.setBounds(220, 150, 130, 30) tfTeacherEmail.setBounds(220, 200, 130, 30) taTeacherAddress.setBounds(220, 250, 130, 80) tfTeacherCourse.setBounds(220, 350, 130, 30) tfTeacherPayment.setBounds(220, 400, 130, 30) btnEnter = JButton("ADD", actionPerformed=clickAddTeacher) btnEnter.setBounds(350, 450, 100, 40) panel.add(heading) panel.add(lbTeacherName) panel.add(lbTeacherPhone) panel.add(lbTeacherEmail) panel.add(lbTeacherAddress) panel.add(lbTeacherCourse) panel.add(lbTeacherPayment) panel.add(tfTeacherName) panel.add(tfTeacherPhone) panel.add(tfTeacherEmail) panel.add(taTeacherAddress) panel.add(tfTeacherCourse) panel.add(tfTeacherPayment) panel.add(btnEnter) frame.add(panel)
def loginPage(): global heading global rbAdmin global rbTeacher global rbStudent global frame global tfLoginId global tfPassword frame = JFrame("Login Form ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 500) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500, 500) panel.setLocation(0, 0) panel.setLayout(None) panel.setBackground(Color.BLUE) heading = JLabel("Admin Login") heading.setBounds(200, 50, 150, 30) rbAdmin = JRadioButton("Admin", actionPerformed=clickRadio) rbTeacher = JRadioButton("Teacher", actionPerformed=clickRadio) rbStudent = JRadioButton("Student", actionPerformed=clickRadio) rbAdmin.setBounds(100, 150, 100, 20) rbTeacher.setBounds(200, 150, 100, 20) rbStudent.setBounds(300, 150, 100, 20) btnGroup = ButtonGroup() btnGroup.add(rbAdmin) btnGroup.add(rbTeacher) btnGroup.add(rbStudent) lbLoginId = JLabel("LoginId") lbPassword = JLabel("Password") lbLoginId.setBounds(100, 230, 150, 30) lbPassword.setBounds(100, 300, 150, 30) tfLoginId = JTextField() tfPassword = JTextField() tfLoginId.setBounds(250, 230, 150, 30) tfPassword.setBounds(250, 300, 150, 30) btnLogin = JButton("Login", actionPerformed=clickLogin) btnLogin.setBounds(350, 350, 100, 30) btnReg = JButton("New Institute Registration", actionPerformed=clickReg) btnReg.setBounds(350, 400, 100, 30) panel.add(heading) panel.add(rbAdmin) panel.add(rbTeacher) panel.add(rbStudent) panel.add(lbLoginId) panel.add(lbPassword) panel.add(tfLoginId) panel.add(tfPassword) panel.add(btnLogin) panel.add(btnReg) panel.setVisible(True) frame.add(panel)
informasiPane = JPanel() informasiTabbedPane = JTabbedPane() informasiTabbedPane.setSize(610, 600) informasiTabbedPane.setLocation(0, 0) #global regFont #regFont = awt.Font("Arial", Font.PLAIN, 13) #panel1 mainFormHelper = JPanel() mainFormHelper.setOpaque(True) mainFormHelper.setLayout(None) informasiTabbedPane.addTab("Halaman Utama", mainFormHelper) mainFormHelper.setSize(610, 599) mainFormHelper.setLocation(0, 0) naiveFormHelper = JPanel() naiveFormHelper.setOpaque(True) naiveFormHelper.setLayout(None) informasiTabbedPane.addTab("Naive Form", naiveFormHelper) naiveFormHelper.setSize(610, 599) naiveFormHelper.setSize(0, 0) hackerFormHelper = JPanel() hackerFormHelper.setOpaque(True) hackerFormHelper.setLayout(None) informasiTabbedPane.addTab("Hacker Form", hackerFormHelper) hackerFormHelper.setSize(610, 599) hackerFormHelper.setSize(0, 0)
intToPrint += encryptedMessage[i][1] myString += encryptedMessage[i][1] if (i % 5 == 0): intToPrint += "\n" print "ini pesan:", intToPrint pesanTerenkripsi.setText("") pesanTerenkripsi.text = intToPrint except (RuntimeError, TypeError, NameError): print "eror gan" naiveForm = JFrame("Naive Form", size=(987, 610)) naiveFormPanel = JPanel() naiveFormPanel.setLocation(0, 0) naiveFormPanel.setOpaque(True) naiveFormPanel.setBackground(Color.WHITE) naiveFormPanel.setLayout(None) # All Text Fields Belong Here betaTextField = awt.TextField(20) betaTextField.setLocation(454, 278) betaTextField.setSize(233, 13) betaTextField.setFont(regFont) primaTextField = awt.TextField(20) primaTextField.setLocation(454, 325) primaTextField.setSize(233, 34) primaTextField.setFont(regFont)
def adminLogined(instObj): global panel global table global heading global btnUpdate global frame frame = JFrame("Admin Page ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(700, 640) frame.setLocation(200, 200) frame.setLayout(None) panel = JPanel() panel.setSize(700, 620) panel.setLocation(0, 20) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.WHITE) heading = JLabel() heading.setBounds(310, 10, 200, 30) table = JTable() table.setBounds(0, 50, 700, 450) sp = JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS) btnUpdate = JButton("Update", actionPerformed=clickUpdate) btnUpdate.setBounds(300, 530, 100, 30) bar = JMenuBar() courses = JMenu("Course") addCourse = JMenuItem("Add Course", actionPerformed=clickAddCourse) showCourseList = JMenuItem("Show Course List", actionPerformed=clickShowCourseList) courses.add(addCourse) courses.add(showCourseList) bar.add(courses) teacher = JMenu("Teacher") addTeacher = JMenuItem("Add Teacher", actionPerformed=clickAddTeacher) showTeacherList = JMenuItem("Show Teacher List", actionPerformed=clickShowTeacherList) showTeacherIdPassword = JMenuItem( "Show Teacher Id Password", actionPerformed=clickShowTeacherIdPassword) teacher.add(addTeacher) teacher.add(showTeacherList) teacher.add(showTeacherIdPassword) bar.add(teacher) student = JMenu("Student") addStudent = JMenuItem("Add Student", actionPerformed=clickAddStudent) showAllStudentList = JMenuItem("Show All Student", actionPerformed=clickShowAllStudent) showStudentsByCourse = JMenuItem("Show Student By course", actionPerformed=clickShowStudentByCourse) showStudentsByTeacher = JMenuItem( "Show Student By Teacher", actionPerformed=clickShowStudentByTeacher) showStudentIdPassword = JMenuItem( "Show Student Id Password", actionPerformed=clickShowStudentIdPassword) student.add(addStudent) student.add(showAllStudentList) student.add(showStudentsByCourse) student.add(showStudentsByTeacher) student.add(showStudentIdPassword) bar.add(student) attendence = JMenu(" Teacher Attendence") teacherAttendence = JMenuItem(" Take Teacher Attendence", actionPerformed=clickTotalAttendence) specificTeacherAttendence = JMenuItem( "Show Specific Teacher Attendence", actionPerformed=clickShowSpecificTeacherAttendence) allTeacherAttendenceMonth = JMenuItem( "All Teacher Attendence In Month", actionPerformed=clickShowAllSTeacherAttendenceMonth) specificTeacherAttendenceInMonth = JMenuItem( "Specific Teacher Attendence In Month", actionPerformed=clickShowSpecificSTeacherAttendenceMonth) allTeacherAttendenceStatisticsInMonth = JMenuItem( "All Teacher Attendence Statistics In Month", actionPerformed=clickShowAllTeacherAttendenceStatisticsMonth) attendence.add(teacherAttendence) attendence.add(specificTeacherAttendence) attendence.add(allTeacherAttendenceMonth) attendence.add(specificTeacherAttendenceInMonth) attendence.add(allTeacherAttendenceStatisticsInMonth) bar.add(attendence) studentAttendence = JMenu(" Student Attendence") specificTeacherStudentsAttendence = JMenuItem( "Show Specific Teacher Students Attendence", actionPerformed=clickShowSpecificTeacherStudentsAttendence) specificCourseStudentsAttendence = JMenuItem( "Show Specific course Students Attendence", actionPerformed=clickShowSpecificCourseStudentsAttendence) specificTeacherStudentsAttendenceInMonth = JMenuItem( "Show Specific teacher Students Attendence In month", actionPerformed=clickShowSpecificTeacherStudentsAttendenceInMonth) specificCourseStudentsAttendenceInMonth = JMenuItem( "Show Specific course Students Attendence In month", actionPerformed=clickShowSpecificCourseStudentsAttendenceInMonth) allStudentsAttendenceStatisticsInMonth = JMenuItem( "All Students Attendence Statistics In month", actionPerformed=clickShowAllStudentsAttendenceStatisticsInMonth) specificTeacherStudentsAttendenceStatisticsInMonth = JMenuItem( "Specific Teacher Students Attendence Statistics In month", actionPerformed= clickShowSpecificTeacherStudentsAttendenceStatisticsInMonth) specificCourseStudentsAttendenceStatisticsInMonth = JMenuItem( "Specific Course Students Attendence Statistics In month", actionPerformed= clickShowSpecificCourseStudentsAttendenceStatisticsInMonth) specificStudentAttendenceInMonth = JMenuItem( "Specific Student Attendence In month", actionPerformed=clickShowSpecificStudentAttendenceInMonth) studentAttendence.add(specificTeacherStudentsAttendence) studentAttendence.add(specificCourseStudentsAttendence) studentAttendence.add(specificTeacherStudentsAttendenceInMonth) studentAttendence.add(specificCourseStudentsAttendenceInMonth) studentAttendence.add(allStudentsAttendenceStatisticsInMonth) studentAttendence.add(specificTeacherStudentsAttendenceStatisticsInMonth) studentAttendence.add(specificCourseStudentsAttendenceStatisticsInMonth) studentAttendence.add(specificStudentAttendenceInMonth) bar.add(studentAttendence) studentFee = JMenu("Student Fee ") payStudentFee = JMenuItem("Pay", actionPerformed=clickPayStudentFee) showStudentFeeListByCourse = JMenuItem( "Student Fee list By Course", actionPerformed=clickShowStudentFeeListByCourse) studentFee.add(payStudentFee) studentFee.add(showStudentFeeListByCourse) bar.add(studentFee) logout = JMenuItem("logout", actionPerformed=clickLogout) bar.add(logout) btnUpdate.setVisible(False) panel.add(table) panel.add(btnUpdate) frame.setJMenuBar(bar) frame.add(panel) frame.setVisible(True)
def studentProfileForm(data): global heading global tfStudentName global tfStudentPhone global taStudentAddress global tfStudentEmail global tfCourseName global tfCourseFee global tfStudentAssignTeacher global frame global btnEnter frame = JFrame(" Student ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 620) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500, 620) panel.setLocation(0, 0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel(" STUDENT PROFILE") heading.setBounds(200, 30, 150, 40) lbStudentName = JLabel("Student Name ") lbStudentPhone = JLabel("Phone") lbStudentEmail = JLabel("Email") lbStudentAddress = JLabel("Address") lbCourseName = JLabel("Course Name ") lbCourseFee = JLabel("Course Fee") lbStudentAssignTeacher = JLabel("Teacher") studentName = data[0].encode('ascii') studentPhone = data[1].encode('ascii') studentEmail = data[2].encode('ascii') studentAddress = data[3].encode('ascii') courseName = data[4].encode('ascii') courseFee = data[5] studentAssignTeacher = data[6].encode('ascii') tfStudentName = JTextField(studentName) tfStudentPhone = JTextField(studentPhone) taStudentAddress = JTextArea(studentAddress) tfStudentEmail = JTextField(studentEmail) tfCourseName = JTextField(courseName) tfCourseFee = JTextField(str(courseFee)) tfStudentAssignTeacher = JTextField(studentAssignTeacher) tfCourseName.setEditable(False) tfCourseFee.setEditable(False) tfStudentAssignTeacher.setEditable(False) tfStudentName.setEditable(False) lbStudentName.setBounds(70, 100, 130, 30) lbStudentPhone.setBounds(70, 150, 130, 30) lbStudentEmail.setBounds(70, 200, 130, 30) lbStudentAddress.setBounds(70, 250, 130, 30) lbCourseName.setBounds(70, 350, 130, 30) lbCourseFee.setBounds(70, 400, 130, 30) lbStudentAssignTeacher.setBounds(70, 450, 130, 30) tfStudentName.setBounds(220, 100, 130, 30) tfStudentPhone.setBounds(220, 150, 130, 30) tfStudentEmail.setBounds(220, 200, 130, 30) taStudentAddress.setBounds(220, 250, 130, 80) tfCourseName.setBounds(220, 350, 130, 30) tfCourseFee.setBounds(220, 400, 130, 30) tfStudentAssignTeacher.setBounds(220, 450, 130, 30) btnEnter = JButton("Update", actionPerformed=clickUpdateStudent) btnEnter.setBounds(350, 530, 100, 40) btnCancel = JButton("Cancel", actionPerformed=clickCancel) btnCancel.setBounds(100, 530, 100, 40) panel.add(heading) panel.add(lbStudentName) panel.add(lbStudentPhone) panel.add(lbStudentEmail) panel.add(lbStudentAddress) panel.add(lbCourseName) panel.add(lbCourseFee) panel.add(lbStudentAssignTeacher) panel.add(tfStudentName) panel.add(tfStudentPhone) panel.add(tfStudentEmail) panel.add(taStudentAddress) panel.add(tfCourseName) panel.add(tfCourseFee) panel.add(tfStudentAssignTeacher) panel.add(btnEnter) panel.add(btnCancel) frame.add(panel)
def updateStudent(stObj): global studentId global tfStudentName global tfStudentPhone global tfStudentEmail global taStudentAddress global tfCourseName global cbStudentAssignTeacher global frame frame = JFrame("Update student ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500,500) frame.setLocation(200,200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500,500) panel.setLocation(0,0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) studentId = getattr(stObj,'studentId') studentName= getattr(stObj,'studentName') studentPhone = getattr(stObj,'studentPhone') studentEmail = getattr(stObj,'studentEmail') studentAddress = getattr(stObj,'studentAddress') studentCourse = getattr(stObj,'courseName') teachersName = srv.showStudentChoiceCourse(studentCourse) v = Vector() for d in teachersName: v.add(d[0].encode('ascii')) heading = JLabel("Update TEACHER") heading.setBounds(200,30,150,40) lbStudentName = JLabel("Student name ") lbStudentPhone = JLabel("Phone") lbStudentEmail = JLabel("Email Id") lbStudentAddress = JLabel("Address") lbStudentAssignTeacher = JLabel("Student Assign teacher ") tfStudentName = JTextField(studentName) tfStudentPhone = JTextField(studentPhone) tfStudentEmail = JTextField(studentEmail) taStudentAddress = JTextArea(studentAddress) cbStudentAssignTeacher = JComboBox(v) lbStudentName.setBounds(70,100,130,30) lbStudentPhone.setBounds(70,150,130,30) lbStudentEmail.setBounds(70,200,130,30) lbStudentAddress.setBounds(70,250,130,30) lbStudentAssignTeacher.setBounds(70,350,130,30) tfStudentName.setBounds(220,100,130,30) tfStudentPhone.setBounds(220,150,130,30) tfStudentEmail.setBounds(220,200,130,30) taStudentAddress.setBounds(220,250,130,80) cbStudentAssignTeacher.setBounds(220,350,130,30) btnEnter = JButton("Update",actionPerformed=clickUpdateStudent) btnEnter.setBounds(350,420,100,40) btnCancel = JButton("Cancel",actionPerformed=clickbtnCancel) btnCancel.setBounds(50,420,100,40) panel.add(heading) panel.add(lbStudentName) panel.add(lbStudentPhone) panel.add(lbStudentEmail) panel.add(lbStudentAddress) panel.add(lbStudentAssignTeacher) panel.add(tfStudentName) panel.add(tfStudentPhone) panel.add(tfStudentEmail) panel.add(taStudentAddress) panel.add(cbStudentAssignTeacher) panel.add(btnEnter) panel.add(btnCancel) frame.add(panel)
def addStudent(courseName, courseFee, v): global tfStudentName global tfStudentPhone global tfStudentEmail global taStudentAddress global tfCourseName global tfCourseFee global cbStudentAssignTeacher global frame frame = JFrame("Add Student ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500, 600) frame.setLocation(200, 200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500, 600) panel.setLocation(0, 0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel("ADD STUDENT") heading.setBounds(200, 30, 150, 40) lbCourseName = JLabel(" Course name") lbCourseFee = JLabel(" Course Fee") lbStudentName = JLabel("Student name ") lbStudentPhone = JLabel("Phone") lbStudentEmail = JLabel("Email Id") lbStudentAddress = JLabel("Address") lbStudentAssignTeacher = JLabel("Student Assign teacher ") tfCourseName = JTextField(courseName) tfCourseFee = JTextField(str(courseFee)) tfStudentName = JTextField() tfStudentPhone = JTextField() tfStudentEmail = JTextField() taStudentAddress = JTextArea() cbStudentAssignTeacher = JComboBox(v) tfCourseName.setEditable(False) tfCourseFee.setEditable(False) lbCourseName.setBounds(70, 100, 130, 30) lbCourseFee.setBounds(70, 150, 130, 30) lbStudentName.setBounds(70, 200, 130, 30) lbStudentPhone.setBounds(70, 250, 130, 30) lbStudentEmail.setBounds(70, 300, 130, 30) lbStudentAddress.setBounds(70, 350, 130, 80) lbStudentAssignTeacher.setBounds(70, 450, 130, 30) tfCourseName.setBounds(220, 100, 130, 30) tfCourseFee.setBounds(220, 150, 130, 30) tfStudentName.setBounds(220, 200, 130, 30) tfStudentPhone.setBounds(220, 250, 130, 30) tfStudentEmail.setBounds(220, 300, 130, 30) taStudentAddress.setBounds(220, 350, 130, 80) cbStudentAssignTeacher.setBounds(220, 450, 130, 30) btnEnter = JButton("ADD", actionPerformed=clickAddStudent) btnEnter.setBounds(350, 510, 100, 40) btnCancel = JButton("Cancel", actionPerformed=clickbtnCancelForm) btnCancel.setBounds(50, 510, 100, 40) panel.add(heading) panel.add(lbCourseName) panel.add(lbCourseFee) panel.add(lbStudentName) panel.add(lbStudentPhone) panel.add(lbStudentEmail) panel.add(lbStudentAddress) panel.add(lbStudentAssignTeacher) panel.add(tfCourseName) panel.add(tfCourseFee) panel.add(tfStudentName) panel.add(tfStudentPhone) panel.add(tfStudentEmail) panel.add(taStudentAddress) panel.add(cbStudentAssignTeacher) panel.add(btnEnter) panel.add(btnCancel) frame.add(panel)
def createStudentFeeForm(stFeeObj): global tfStudentId global tfStudentName global tfTotalAmount global tfPaidAmount global tfRemainingAmount global frame frame = JFrame("Student Fee Form ") frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(500,500) frame.setLocation(200,200) frame.setLayout(None) frame.setVisible(True) panel = JPanel() panel.setSize(500,500) panel.setLocation(0,0) panel.setLayout(None) panel.setVisible(True) panel.setBackground(Color.LIGHT_GRAY) heading = JLabel("STUDENT FEE") heading.setBounds(200,30,150,40) lbStudentId = JLabel(" Student id") lbStudentName = JLabel(" student name") lbTotalAmount = JLabel("Total Amount ") lbPaidAmount = JLabel("Paid Amount") lbRemainingAmount = JLabel("Remaining amount") studentId =getattr(stFeeObj,'studentId') studentName =getattr(stFeeObj,'studentName') totalAmount =getattr(stFeeObj,'totalAmount') paidAmount =getattr(stFeeObj,'paidAmount') remainingAmount =getattr(stFeeObj,'remainingAmount') tfStudentId = JTextField(str(studentId)) tfStudentName = JTextField(str(studentName)) tfTotalAmount = JTextField(str(totalAmount)) tfPaidAmount = JTextField(str(paidAmount)) tfRemainingAmount = JTextField(str(remainingAmount)) tfStudentId.setEditable(False) tfStudentName.setEditable(False) tfTotalAmount.setEditable(False) tfRemainingAmount.setEditable(False) lbStudentId.setBounds(70,100,130,30) lbStudentName.setBounds(70,150,130,30) lbTotalAmount.setBounds(70,200,130,30) lbPaidAmount.setBounds(70,250,130,30) lbRemainingAmount.setBounds(70,300,130,30) tfStudentId.setBounds(220,100,130,30) tfStudentName.setBounds(220,150,130,30) tfTotalAmount.setBounds(220,200,130,30) tfPaidAmount.setBounds(220,250,130,30) tfRemainingAmount.setBounds(220,300,130,30) btnPay = JButton("Paid",actionPerformed=clickPay) btnPay.setBounds(350,410,100,40) btnCancel = JButton("Cancel",actionPerformed=clickbtnCancelForm) btnCancel.setBounds(50,410,100,40) panel.add(heading) panel.add(lbStudentId) panel.add(lbStudentName) panel.add(lbTotalAmount) panel.add(lbPaidAmount) panel.add(lbRemainingAmount) panel.add(tfStudentId) panel.add(tfStudentName) panel.add(tfTotalAmount) panel.add(tfPaidAmount) panel.add(tfRemainingAmount) panel.add(btnPay) panel.add(btnCancel) frame.add(panel)
tabbedPane = JTabbedPane() tabbedPane.setSize(377, 377) tabbedPane.setLocation(15, 5) tabbedPane.setVisible(True) #panel1 p1 = JPanel() p1.setOpaque(True) p1.setBackground(Color.WHITE) p1.setLayout(None) p1.setSize(357, 337) p1.setLocation(0, 0) p1.setVisible(True) generatedMatrix = awt.TextArea("-",7,7) scrollPane1 = JScrollPane(generatedMatrix) try: generatedMatrix.text = string1#myIOControl.derDrucker(gIC, gFB, gGamma) except: print "Gagal melaporkan tahap 1" generatedMatrix.setSize(393, 331) generatedMatrix.setLocation(5, 5) generatedMatrix.setBackground(Color.GRAY) p1.add(generatedMatrix)