X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTList.java;h=6b0a205bf422e2bd18cc186f226777d6c0c98084;hb=9240f032a51de25bdc90bdebec99bb63896b24d0;hp=38a994c8215bbba2a53e3c85d0b15bd46c099146;hpb=3d3e09e625a95ca9b005166f4a9924c9aadfc65c;p=fanfix.git diff --git a/src/jexer/TList.java b/src/jexer/TList.java index 38a994c..6b0a205 100644 --- a/src/jexer/TList.java +++ b/src/jexer/TList.java @@ -335,21 +335,28 @@ public class TList extends TScrollableWidget { @Override public void setWidth(final int width) { super.setWidth(width); - hScroller.setWidth(getWidth() - 1); - vScroller.setX(getWidth() - 1); + if (hScroller != null) { + hScroller.setWidth(getWidth() - 1); + } + if (vScroller != null) { + vScroller.setX(getWidth() - 1); + } } /** * Override TWidget's height: we need to set child widget heights. - * time. * * @param height new widget height */ @Override public void setHeight(final int height) { super.setHeight(height); - hScroller.setY(getHeight() - 1); - vScroller.setHeight(getHeight() - 1); + if (hScroller != null) { + hScroller.setY(getHeight() - 1); + } + if (vScroller != null) { + vScroller.setHeight(getHeight() - 1); + } } /**