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
clean readme
[fanfix.git]
/
src
/
jexer
/
TField.java
diff --git
a/src/jexer/TField.java
b/src/jexer/TField.java
index 07a457bcf7eb7beb4e05af9e71f8f782a6cc2227..083fc90e7d18239892624bc634f60f4b97cebfad 100644
(file)
--- a/
src/jexer/TField.java
+++ b/
src/jexer/TField.java
@@
-1,4
+1,4
@@
-/*
*
+/*
* Jexer - Java Text User Interface
*
* License: LGPLv3 or later
* Jexer - Java Text User Interface
*
* License: LGPLv3 or later
@@
-55,6
+55,17
@@
public class TField extends TWidget {
return text;
}
return text;
}
+ /**
+ * Set field text.
+ *
+ * @param text the new field text
+ */
+ public final void setText(String text) {
+ this.text = text;
+ position = 0;
+ windowStart = 0;
+ }
+
/**
* If true, only allow enough characters that will fit in the width. If
* false, allow the field to scroll to the right.
/**
* If true, only allow enough characters that will fit in the width. If
* false, allow the field to scroll to the right.
@@
-201,7
+212,7
@@
public class TField extends TWidget {
end = text.length();
}
getScreen().hLineXY(0, 0, getWidth(), GraphicsChars.HATCH, fieldColor);
end = text.length();
}
getScreen().hLineXY(0, 0, getWidth(), GraphicsChars.HATCH, fieldColor);
- getScreen().putStrXY(0, 0, text.substring(windowStart, end),
+ getScreen().putStr
ing
XY(0, 0, text.substring(windowStart, end),
fieldColor);
// Fix the cursor, it will be rendered by TApplication.drawAll().
fieldColor);
// Fix the cursor, it will be rendered by TApplication.drawAll().