srs.java
来自「一个美国教授写得很好的java学生管理系统」· Java 代码 · 共 58 行
JAVA
58 行
// SRS.java - Chapter 16 version.
// Copyright 2000 by Jacquie Barker - all rights reserved.
// A main driver for the GUI version of the SRS.
package UserInterface;
import java.util.*;
import Persons.Faculty;
import Courses.CourseCatalog;
import Courses.ScheduleOfClasses;
public class SRS {
// We can effectively create "global" data by declaring
// PUBLIC STATIC attributes in the main class.
// Entry points/"roots" for getting at objects.
public static Faculty faculty = new Faculty();
public static CourseCatalog courseCatalog = new CourseCatalog();
public static ScheduleOfClasses scheduleOfClasses =
new ScheduleOfClasses("SP2001");
// We don't create a collection for Student objects, because
// we're only going to handle one Student at a time -- namely,
// whichever Student is logged on.
//? public static StudentBody studentBody = new StudentBody();
public static void main(String[] args) {
// Initialize the key objects by reading data from files.
faculty.initializeObjects("Faculty.dat", true);
courseCatalog.initializeObjects("CourseCatalog.dat", true);
scheduleOfClasses.initializeObjects("SoC_SP2001.dat", true);
// We'll handle the students differently: that is,
// rather than loading them all in at application outset,
// we'll pull in the data that we need just for one
// Student when that Student logs on -- see the Student
// class constructor for the details.
//? studentBody.initializeObjects("StudentBody.dat");
// Establish some prerequisites (c1 => c2 => c3 => c4).
courseCatalog.initializeObjects("Prerequisites.dat", false);
// Recruit a professor to teach each of the sections.
faculty.initializeObjects("TeachingAssignments.dat", false);
// Create and display an instance of the main GUI window.
//? mainFrame = new MainFrame();
new MainFrame();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?