final project q8

This commit is contained in:
2022-05-24 23:35:04 +08:00
parent d3cf0c7a7c
commit 3dc6689804
15 changed files with 552 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());
}
}