Курсовая работа: Объектно-ориентированное программирование учебных систем
JPanel info;
JLabel mark;
JPanel button;
KMainWin (int who, final String login, final String password) throws FileNotFoundException, IOException {
super ("Main window");
f = this;
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setLayout(new FlowLayout ());
final BufferedWriter bd = new BufferedWriter(new FileWriter(Consts.log, true));
bd.write(new Date().getHours() + ":" + new Date ().getMinutes() + " " + new Date ().getDay() + "/" + new Date ().getMonth() + "/" + new Date ().getYear() + "\n");
bd.write(login + " loged in\n");
logout = new JButton ("Log out");
logout.setPreferredSize(size);
exit = new JButton ("Выход");
exit.setPreferredSize(size);
logout.addActionListener(new ActionListener (){
public void actionPerformed(ActionEvent e) {
try {
bd.write(new Date().getHours() + ":" + new Date ().getMinutes() + " " + new Date ().getDay() + "/" + new Date ().getMonth() + "/" + new Date ().getYear() + "\n");
bd.write(login + " logged out\n");
bd.close();
} catch (IOException ex) {
Logger.getLogger(KMainWin.class.getName()).log(Level.SEVERE, null, ex);
}
dispose();
new KLogin();
try {
bd.close();
} catch (IOException ex) {