import javax.swing.*;
-public class WeightView extends JComponent {
+public class WeightView extends JPanel {
private Weight weightObj;
-
- WeightView() {
- }
+ private JLabel label;
WeightView(Weight weightObj) {
setWeightObj(weightObj);
+ this.label = new JLabel();
+ this.label.setText("Weight");
+ add(label);
}
public Weight getWeightObj() {