예제 #1
0
  public void init() {
    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));

    JLabel nameLabel = new JLabel(getFieldName());
    valueField = new JPanel();
    valueField.setPreferredSize(new Dimension(10, 10));

    add(valueField);
    add(nameLabel);
    revalidate();
    repaint();
  }
예제 #2
0
 @Override
 public void setValue(final boolean value) {
   this.value = value;
   valueField.setBackground(value ? colorOnTrue.getValue() : colorOnFalse.getValue());
   repaint();
 }