import javax.swing.JPanel;

import javax.swing.JLabel;
import java.awt.BorderLayout;

public class UIValDisplay extends JPanel {
  private JLabel nlabel;
  private JLabel vlabel;

  public UIValDisplay(String n, int v) {
    nlabel = new JLabel(n,JLabel.CENTER);
    vlabel = new JLabel(Integer.toString(v),JLabel.CENTER);
    setLayout(new BorderLayout());
    add(nlabel,BorderLayout.NORTH);
    add(vlabel,BorderLayout.SOUTH);
  }

  public void setValue(int v) { vlabel.setText(Integer.toString(v)); }
  public void setValue(double d) { vlabel.setText(Double.toString(d); }

}

