lab 13
This commit is contained in:
21
lab/lab13/Question2/ViewNumber.java
Normal file
21
lab/lab13/Question2/ViewNumber.java
Normal file
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller> {
|
||||
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
this.setTitle("View Number");
|
||||
this.setSize(150, 150);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user