<swingDialog>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><frame><frameset><head><link rel="stylesheet" type="text/css" href="theme.css" /></head>
<head><script>alert('Hi there!');</script></head>
<head><title>TITLE</title></head>
<input type="submit" /><link><noframes><script><title>The following HTML tags create unexpected results and are therefore not useful:
<body>body</body><html>html</html><isindex>isindex</isindex><object><param name="x" value="y" /></object>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
| 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. |
| Name | Description |
|---|---|
<checkbox>
|
Adds a JCheckBox to the dialog.
|
<ifCancel>
|
Configures the tasks to be executed when the user hits the CANCEL button.
|
<ifClosed>
|
Configures the tasks to be executed when the user closes the dialog (instead of hitting one of the buttons). |
<ifNo>
|
Configures the tasks to be executed when the user hits the NO button.
|
<ifOk>
|
Configures the tasks to be executed when the user hits the OK button.
|
<ifYes>
|
Configures the tasks to be executed when the user hits the YES button.
|
<label>
|
Adds a JLabel to the dialog.
|
<list>
|
Adds a JList to the dialog.
|
<radioButton>
|
Adds a JRadioButton to the dialog.
|
<separator>
|
Adds a JSeparator to the dialog.
|
<text>
|
(deprecated) |
<textArea>
|
Adds a JTextArea to the dialog.
|
<textField>
|
Adds a JTextField to the dialog.
|
Default values are underlined.
optionType="DEFAULT|YES_NO|YES_NO_CANCEL|OK_CANCEL"DEFAULT" means a single OK button.)
messageType="ERROR|INFORMATION|WARNING|QUESTION|PLAIN"PLAIN, then a respective icon is displayed in the dialog.
<label>JLabel to the dialog.
<html>"; see here.
<text><textField> instead.secure="true|false"JTextField is not echoed.
label="text"labelWidth="pixels"label="..."property="property-name"defaultValue="text"focus="true|false"enabled="true|false"false, then the control is grayed out and is not editable.
<textField>JTextField to the dialog.
secure="true|false"JTextField is not echoed.
label="text"labelWidth="pixels"label="..."property="property-name"defaultValue="text"focus="true|false"enabled="true|false"false, then the control is grayed out and is not editable.
<textArea>JTextArea to the dialog.
The following attributes are mutually exclusive:
file="file"JTextArea to the designated file when the dialog is completed (optional).
append="true|false"file=... (instead of recreating it).
defaultFile="default-file"JTextArea with the content of the default-file (optional).
rows="n"JTextArea to the designated number of rows.
columns="n"JTextArea to the designated number of columns.
encoding="charset"file="..." and the defaultFile="...".
property="property-name"defaultValue="text"focus="true|false"enabled="true|false"false, then the control is grayed out and is not editable.
<checkbox>JCheckBox to the dialog.
JCheckBox (optional). May contain HTML markup iff it starts with "<html>"; see here.
text="text"JCheckBox (optional). May contain HTML markup iff it starts with "<html>"; see here.
property="property-name"true" or "false" when the dialog is completed (optional).
preselected="true|false"JCheckBox is intially checked or not.
focus="true|false"JCheckBox should initially receive focus when the dialog opens.
enabled="true|false"false, then the control is grayed out and is not modifiable.
<radioButton>JRadioButton to the dialog.
JRadioButton (optional). May contain HTML markup iff it starts with "<html>"; see here.
text="text"JRadioButton (optional). May contain HTML markup iff it starts with "<html>"; see here.
property="property-name"value="..." or text="..." when the dialog is completed (mandatory).
value="value"preselected="true|false"JRadioButton is intially selected or not.
focus="true|false"JRadioButton should initially receive focus when the dialog opens.
enabled="true|false"false, then the control is grayed out and neither selectable nor deselectable.
<list>JList to the dialog.
The following attributes are mutually exclusive:
defaultValues="..."defaultIndices="..."selectionMode="SINGLE|SINGLE_INTERVAL|MULTIPLE_INTERVAL"SINGLESINGLE_INTERVALMULTIPLE_INTERVALJList.setSelectionMode(int)property="property-name"values="values"labels="labels"defaultValues="values"defaultIndices="indexes"delimiters="delimiters|,"focus="true|false"JList should initially receive focus when the dialog opens.
enabled="true|false"false, then the control is grayed out and its items neither selectable nor deselectable.
visibleRowCount="n"The default is to adapt the list height to the number of values and not display a scroll bar.
<separator>JSeparator to the dialog.
<ifYes>YES button.
Task
<ifNo>NO button. If none of <ifYes> and <ifNo> are configured and the user hits the NO button, then the task fails.
Task
<ifCancel>CANCEL button. If this property is not configured configured and the user hits "CANCEL", then the task fails.
Task
<ifOk>OK button.
Task
<ifClosed>If this property is not configured configured and the user closes the dialog, then the task fails.
Task
Copyright © 2019. All rights reserved.