X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjexer%2Fdemos%2FDemoTextWindow.java;h=265c45db7f6f73ae1d8666f78d1772a2b519b6b5;hb=a043164fd1cc1b38f03bb104f8b5240cdf5705c6;hp=aa68f892828d19d274d69758bb157fa9d186ccf7;hpb=e3dfbd233442a877d5efa1bc177c3d357771e5cb;p=fanfix.git diff --git a/src/jexer/demos/DemoTextWindow.java b/src/jexer/demos/DemoTextWindow.java index aa68f89..265c45d 100644 --- a/src/jexer/demos/DemoTextWindow.java +++ b/src/jexer/demos/DemoTextWindow.java @@ -32,27 +32,38 @@ package jexer.demos; import jexer.*; import jexer.event.*; -import jexer.menu.*; /** * This window demonstates the TText, THScroller, and TVScroller widgets. */ -class DemoTextWindow extends TWindow { +public class DemoTextWindow extends TWindow { /** * Hang onto my TText so I can resize it with the window. */ 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 @@ 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"); + } /**