/** * Create a instance of this check entry and set the configuration entry that is used to setup * this class. * * @param usedEntry the entry used to setup this class, the entry needs to pass the check with the * static method */ @SuppressWarnings("nls") public NumberEntryAwt(final ConfigEntry usedEntry) { super(new BorderLayout(10, 0)); if (!isUsableEntry(usedEntry)) { throw new IllegalArgumentException("ConfigEntry type illegal."); } entry = (NumberEntry) usedEntry; currentValue = entry.getValue(); display = new Label(Integer.toString(currentValue)); add(display, BorderLayout.EAST); final Scrollbar scroll = new Scrollbar(); scroll.setOrientation(Scrollbar.HORIZONTAL); scroll.setValues(currentValue, 1, entry.getRange().getMin(), entry.getRange().getMax() + 1); scroll.addAdjustmentListener(new NumberEntryScrollListener(this)); add(scroll, BorderLayout.CENTER); setMinimumSize(new Dimension(300, 10)); }