X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fdemos%2FDemoTextWindow.java;h=265c45db7f6f73ae1d8666f78d1772a2b519b6b5;hb=8582f35a3ffb8212463076217eb89278f42331d4;hp=81235cdad2d1b8330dfcc8de0d6602838e2ea42e;hpb=7668cb45fd91775da14504919d8a239af2f7c07e;p=fanfix.git diff --git a/src/jexer/demos/DemoTextWindow.java b/src/jexer/demos/DemoTextWindow.java index 81235cd..265c45d 100644 --- a/src/jexer/demos/DemoTextWindow.java +++ b/src/jexer/demos/DemoTextWindow.java @@ -32,7 +32,6 @@ package jexer.demos; import jexer.*; import jexer.event.*; -import jexer.menu.*; /** * This window demonstates the TText, THScroller, and TVScroller widgets. @@ -44,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" + @@ -70,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"); + } /**