final project q12 giveup

This commit is contained in:
2022-05-24 23:53:18 +08:00
parent 252d0c67bb
commit 88a587102f
22 changed files with 784 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/*
* Author: CHEN Yongyuan (Walter) 1930006025 from OOP(1007)
* Date: 2022-04-25
*/
import javax.swing.JLabel;
public class ViewSimple extends View<ControllerSimple> {
private JLabel label;
public ViewSimple(Library m, ControllerSimple c) {
super(m, c);
// window
this.setTitle("View Simple");
this.setSize(300, 200);
// conponent
label = new JLabel("Total number of borrowed books: " + m.totalBorrowedBooks());
add(label);
// final
this.setVisible(true);
}
public void update() {
label.setText("Total number of borrowed books: " + m.totalBorrowedBooks());
}
}