All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----net.strandberg.html.Selection
You would need HTML code like this:
Preferred OS: <SELECT NAME="prefos"> <OPTION VALUE="sunos"> Solaris <OPTION VALUE="wnt"> Windows NT <OPTION VALUE="w95"> Windows 95 </SELECT>which is created by this java code:
Selection sel = new Selection("prefos", "Preferred OS:", false); sel.addOption("sunos", "Solaris"); sel.addOption("wnt", "Windows NT"); sel.addOption("w95", "Windows 95"); String myString = sel.toHTML();If the size of a Selection is set to an integer value greater than 1, it will appear as a list (see below)
If the size of a Selection is set to an integer value greater than 1, and the proerty multi is set to true, the Selection will appear as a list where where multiple selections are possible (see below)
Comment: This gadget is known by many names. In HTML it is called SELECT
or selection,
in Java it is called "Choice", in Motif it is called ComboBox etc.
public Selection(String name, String label)
public Selection(String name, String label, boolean asTableItem)
public Selection(String name, String label, boolean asTableItem, int size)
public Selection(String name, String label, boolean asTableItem, int size, boolean multi)
public void addOption(String name, String label)
public String toHTML()
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index