antology 2.0.7
Task

<swingDialog>

Pops up a highly configurable dialog and invites the user to fill in form fields.

HTML label texts

Some dialog components (see the components' descriptions, below) allow for (limited) HTML markup.

The following HTML tags appear to work as expected:

<a href="http://www.google.de">A link</a> (underlined, but not clickable)
<a name="myanchor" /> (not useful)
<address>An address</address>
<b>Bold text</b>
<big>Bigger text</big>
<blockquote>A block quote</blockquote>
<br />
<center>Centered block</center>
<cite>A citation, italics</cite>
<code>Monospaced code</code>
<dfn>A definition, italics</dfn>
<dir><li>foo.java</li><li>bar.java</li></dir>
<div>A block</div>
<dl><dt>Definition term</dt><dd>Definition description</dd></dl>
<em>Emphasized text</em>
<font color="red" size="17">Alternate font</font>
<form>Input form</form> (not submittable)
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<head><base href="xyz" /></head> (has no effect)
<head><basefont color="red" /></head> (has no effect)
<head><meta name="author" content="me" /></head> (prints as text)
<head><noscript>NOSCRIPT</noscript></head> (prints as text)
<head><style>h1 { color:red; }</style></head> (must be the first tag after "")
<hr>Horizontal ruler</hr>
<i>Italic text</i>
<img src="icon.png" />
<input type="text" />
<input type="checkbox" />
<input type="radio" />
<input type="reset" /> (not functional)
<kbd>Keyboard input</kbd>
<map><area /></map> (not useful)
<menu><menuitem label="foo" /></menu> (ignored)
<ol><li>Ordered list item</li></ol>
<p>Paragraph</p>
<pre>Preformatted text, monospaced</pre>
<samp>Sample output, monospaced</samp>
<select><option>Selection option</option></select>
<small>Smaller text</small>
<span style="color:red">Grouped inline elements</span>
<strike>Crossed-out text</strike>
<s>Text that is no longer correkt (strikethrough)</s>
<strong>Strong text, bold</strong>
<sub>Subscript text</sub>
<sup>Superscript text</sup>
<table border=1><caption>A caption</caption><tr><th>Heading</th><td>Cell</td></tr></table>
<textarea rows="4">A multi-line text area</textarea>
<tt>Teletype text</tt>
<u>Underlined text</u>
<ul><li>li</li></ul>
<var>A variable, italics</var>

The following HTML tags throw exceptions and are therefore not useful:

<applet>
java.lang.ClassCastException: javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent
<frame>
java.lang.RuntimeException: Can't build aframeset, BranchElement(frameset) 226,227
<frameset>
java.lang.RuntimeException: Can't build aframeset, BranchElement(frameset) 226,227
<head><link rel="stylesheet" type="text/css" href="theme.css" /></head>
java.lang.ClassCastException: javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent
<head><script>alert('Hi there!');</script></head>
java.lang.ClassCastException: javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent
<head><title>TITLE</title></head>
java.lang.ClassCastException: javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent
<input type="submit" />
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
<link>
javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent
<noframes>
java.lang.ClassCastException: javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent
<script>
java.lang.ClassCastException: javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent
<title>
java.lang.ClassCastException: javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent

The following HTML tags create unexpected results and are therefore not useful:

<body>body</body>
Terminates the document
<html>html</html>
Terminates the document
<isindex>isindex</isindex>
Breaks the layout
<object><param name="x" value="y" /></object>
Displays "??"
See also:
HTML.getTag(String)
HTMLEditorKit.HTMLFactory
    • Text

      • Text between start and end tag

        Each line of the text is mapped to a JLabel, as if there was a <label> subelement.

        Due to the way that ANT handles literal text, all these labels appear above the other GUI elements configured through subelements, even if the text appears below the subelement. That is,

         <swingDialog>ONE<label>TWO</label>THREE</swingDialog>

        will appear as

    • Attribute Summary

      Attributes 
      Name Description
      messageType="..." If not set to PLAIN, then a respective icon is displayed in the dialog.
      optionType="..." Which buttons to display in the dialog.
      property="..." If configured, the the named property will be set to "YES", "NO", "CANCEL", "OK" or "CLOSED" when the task completes.
      title="..." The text to be displayed in the title bar of the dialog.
antology 2.0.7

Copyright © 2019. All rights reserved.