X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fdemos%2FDemoTextWindow.java;h=265c45db7f6f73ae1d8666f78d1772a2b519b6b5;hb=a043164fd1cc1b38f03bb104f8b5240cdf5705c6;hp=711bf3bf9ff6dab2795f246339d9ee784a4e88e7;hpb=0d47c5460c8e9d1198928308767a63ad35f46eb8;p=fanfix.git diff --git a/src/jexer/demos/DemoTextWindow.java b/src/jexer/demos/DemoTextWindow.java index 711bf3b..265c45d 100644 --- a/src/jexer/demos/DemoTextWindow.java +++ b/src/jexer/demos/DemoTextWindow.java @@ -43,15 +43,27 @@ public class DemoTextWindow extends TWindow { */ private TText textField; + /** + * Public constructor makes a text window out of any string. + * + * @param parent the main application + * @param title the text string + * @param text the text string + */ + public DemoTextWindow(final TApplication parent, final String title, + final String text) { + + super(parent, title, 0, 0, 44, 20, RESIZABLE); + textField = addText(text, 1, 1, 40, 16); + } + /** * Public constructor. * * @param parent the main application */ public DemoTextWindow(final TApplication parent) { - super(parent, "Text Areas", 0, 0, 44, 20, RESIZABLE); - - textField = addText( + this(parent, "Text Area", "This is an example of a reflowable text field. Some example text follows.\n" + "\n" + "This library implements a text-based windowing system loosely\n" + @@ -69,8 +81,8 @@ public class DemoTextWindow extends TWindow { "This library is licensed LGPL (\"GNU Lesser General Public License\")\n" + "version 3 or greater. See the file COPYING for the full license text,\n" + "which includes both the GPL v3 and the LGPL supplemental terms.\n" + -"\n", - 1, 1, 40, 16); +"\n"); + } /**