ActionListener
, EventListener
, SwingConstants
public class FormView extends ComponentView implements ActionListener
HTMLDocument.HTMLReader.FormAction
. If there are multiple views mapped over the document, they will share the embedded component models. The following table shows what components get built by this view.
Element Type | Component built |
---|---|
input, type button | JButton |
input, type checkbox | JCheckBox |
input, type image | JButton |
input, type password | JPasswordField |
input, type radio | JRadioButton |
input, type reset | JButton |
input, type submit | JButton |
input, type text | JTextField |
select, size > 1 or multiple attribute defined | JList in a JScrollPane |
select, size unspecified or 1 | JComboBox |
textarea | JTextArea in a JScrollPane |
input, type file | JTextField |
Modifier and Type | Class | Description |
---|---|---|
protected class |
FormView.MouseEventListener |
MouseEventListener class to handle form submissions when an input with type equal to image is clicked on. |
Modifier and Type | Field | Description |
---|---|---|
static final String |
RESET |
Deprecated. As of 1.3, value comes from UIManager UIManager property FormView.resetButtonText |
static final String |
SUBMIT |
Deprecated. As of 1.3, value now comes from UIManager property FormView.submitButtonText |
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor | Description |
---|---|
FormView |
Creates a new FormView object. |
Modifier and Type | Method | Description |
---|---|---|
void |
actionPerformed |
Responsible for processing the ActionEvent. |
protected Component |
createComponent() |
Create the component. |
float |
getMaximumSpan |
Determines the maximum span for this view along an axis. |
protected void |
imageSubmit |
This method is called to submit a form in response to a click on an image -- an <INPUT> form element of type "image". |
protected void |
submitData |
This method is responsible for submitting the form data. |
getAlignment, getComponent, getMinimumSpan, getPreferredSpan, modelToView, paint, setParent, viewToModel
append, breakView, changedUpdate, createFragment, forwardUpdate, forwardUpdateToView, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, setSize, updateChildren, updateLayout, viewToModel
@Deprecated public static final String SUBMIT
@Deprecated public static final String RESET
public FormView(Element elem)
elem
- the element to decorateprotected Component createComponent()
createComponent
in class ComponentView
public float getMaximumSpan(int axis)
getMaximumSpan
in class ComponentView
axis
- may be either View.X_AXIS or View.Y_AXISIllegalArgumentException
- for an invalid axispublic void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
evt
- the ActionEvent.protected void submitData(String data)
data
- data to submitprotected void imageSubmit(String imageData)
imageData
- the mouse click coordinates.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/text/html/FormView.html