- page.setPreferredSize(new Dimension(page.getPreferredSize().width * 2,
+ page.setPreferredSize(
+ new Dimension(new JButton("1234").getPreferredSize().width,
+ new JButton("dummy").getPreferredSize().height));
+ page.setMaximumSize(new Dimension(Integer.MAX_VALUE,
- * @return TRUE if the index changed
- *
- * @throws IndexOutOfBoundsException
- * if the index is out of bounds according to
- * {@link NavBar#getMin()} and {@link NavBar#getMax()}.
+ * @return TRUE if the index changed, FALSE if not (either it was already at
+ * that value, or it is outside of the bounds set by
+ * {@link NavBar#min} and {@link NavBar#max})
first.setEnabled(index > min);
previous.setEnabled(index > min);
next.setEnabled(index < max || max == -1);
first.setEnabled(index > min);
previous.setEnabled(index > min);
next.setEnabled(index < max || max == -1);