Ejemplo n.º 1
0
 private void updateButtons() {
   int index = list.getSelectedIndex();
   remove.setEnabled(index != -1 && listModel.getSize() != 0);
   moveUp.setEnabled(index > 0);
   moveDown.setEnabled(index != -1 && index != listModel.getSize() - 1);
   edit.setEnabled(index != -1);
 }
Ejemplo n.º 2
0
  private void updatePreview() {
    String family = familyField.getText();
    int size;
    try {
      size = Integer.parseInt(sizeField.getText());
    } catch (Exception e) {
      size = 12;
    }
    int style = styleList.getSelectedIndex();

    preview.setFont(new Font(family, style, size));
  }