git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'subtree'
[fanfix.git]
/
src
/
jexer
/
TList.java
diff --git
a/src/jexer/TList.java
b/src/jexer/TList.java
index 38a994c8215bbba2a53e3c85d0b15bd46c099146..12e0b8a33cce977e93ce4a6fd30080adeb75e8dc 100644
(file)
--- 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);
@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.
}
/**
* 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);
*
* @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);
+ }
}
/**
}
/**
@@
-391,6
+398,9
@@
public class TList extends TScrollableWidget {
int topY = 0;
for (int i = begin; i < strings.size(); i++) {
String line = strings.get(i);
int topY = 0;
for (int i = begin; i < strings.size(); i++) {
String line = strings.get(i);
+ if (line == null) {
+ line = "";
+ }
if (getHorizontalValue() < line.length()) {
line = line.substring(getHorizontalValue());
} else {
if (getHorizontalValue() < line.length()) {
line = line.substring(getHorizontalValue());
} else {