private int restoreWindowX;
private int restoreWindowY;
+ /**
+ * Set the maximum width for this window.
+ *
+ * @param maximumWindowWidth new maximum width
+ */
+ public final void setMaximumWindowWidth(final int maximumWindowWidth) {
+ this.maximumWindowWidth = maximumWindowWidth;
+ }
+
/**
* Public constructor. Window will be located at (0, 0).
*
}
}
if (keypress.equals(kbShiftLeft)) {
- if (getWidth() > minimumWindowWidth) {
+ if ((getWidth() > minimumWindowWidth)
+ || (minimumWindowWidth <= 0)
+ ) {
setWidth(getWidth() - 1);
}
}
if (keypress.equals(kbShiftRight)) {
- if (getWidth() < maximumWindowWidth) {
+ if ((getWidth() < maximumWindowWidth)
+ || (maximumWindowWidth <= 0)
+ ) {
setWidth(getWidth() + 1);
}
}
if (keypress.equals(kbShiftUp)) {
- if (getHeight() > minimumWindowHeight) {
+ if ((getHeight() > minimumWindowHeight)
+ || (minimumWindowHeight <= 0)
+ ) {
setHeight(getHeight() - 1);
}
}
if (keypress.equals(kbShiftDown)) {
- if (getHeight() < maximumWindowHeight) {
+ if ((getHeight() < maximumWindowHeight)
+ || (maximumWindowHeight <= 0)
+ ) {
setHeight(getHeight() + 1);
}
}