+ /**
+ * 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, 22, RESIZABLE);
+ textField = addText(text, 1, 3, 40, 16);
+
+ addButton("&Left", 1, 1, new TAction() {
+ public void DO() {
+ textField.leftJustify();
+ }
+ });
+
+ addButton("&Center", 10, 1, new TAction() {
+ public void DO() {
+ textField.centerJustify();
+ }
+ });
+
+ addButton("&Right", 21, 1, new TAction() {
+ public void DO() {
+ textField.rightJustify();
+ }
+ });
+
+ addButton("&Full", 31, 1, new TAction() {
+ public void DO() {
+ textField.fullJustify();
+ }
+ });
+
+ statusBar = newStatusBar("Reflowable text window");
+ statusBar.addShortcutKeypress(kbF1, cmHelp, "Help");
+ statusBar.addShortcutKeypress(kbF2, cmShell, "Shell");
+ statusBar.addShortcutKeypress(kbF3, cmOpen, "Open");
+ statusBar.addShortcutKeypress(kbF10, cmExit, "Exit");
+ }
+