X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fsave%2FUpDownToggler.java;h=ffdc1d662725ea77e3fc52a6bf9e86f8961168a8;hp=274bfe98d59358c0ad0ef75e3fc14268625c9a69;hb=da0b1f449260a0b4a94318006382a9039726ef3e;hpb=5625a1abadb5f2ca5f017fe7dbda1d5141cb637b diff --git a/tim/prune/save/UpDownToggler.java b/tim/prune/save/UpDownToggler.java index 274bfe9..ffdc1d6 100644 --- a/tim/prune/save/UpDownToggler.java +++ b/tim/prune/save/UpDownToggler.java @@ -13,21 +13,27 @@ public class UpDownToggler implements ListSelectionListener { private JButton _upButton = null; private JButton _downButton = null; - private int _maxIndex = 0; + private int _maxIndex = 2; /** - * Constructor giving buttons and size + * Constructor giving buttons to enable/disable * @param inUpButton up button * @param inDownButton down button - * @param inListSize size of list */ - public UpDownToggler(JButton inUpButton, JButton inDownButton, int inListSize) + public UpDownToggler(JButton inUpButton, JButton inDownButton) { _upButton = inUpButton; _downButton = inDownButton; - _maxIndex = inListSize - 1; } + /** + * Set the list size + * @param inListSize number of items in list + */ + public void setListSize(int inListSize) + { + _maxIndex = inListSize - 1; + } /** * list selection has changed