public class LabelFieldPanel extends JPanel
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
LabelFieldPanel()
Create a new label field panel.
|
Modifier and Type | Method and Description |
---|---|
Component |
add(Component component) |
Component |
add(Component component,
int index) |
void |
add(Component component,
Object constraints) |
void |
add(Component component,
Object constraints,
int index) |
Component |
add(String name,
Component component) |
void |
addField(JComponent field)
Add the specified field to this label field panel.
|
void |
addField(JLabel label,
JComponent field)
Add the specified label and field to this label field panel.
|
void |
addField(String text,
JComponent field)
Add the specified label and field to this label field panel.
|
void |
addField(String labelText,
String fieldText)
Add the specified field to this label field panel.
|
void |
addFinalField(JComponent field)
Add the specified final field to this label field panel,
that is a field that stretches horizontally across both the
label and field columns and stretches vertically to cover space
left at the bottom of this container.
|
void |
addFinalSpacing()
Add final spacing to this label field panel, that is spacing
that stretches vertically to cover space left at the bottom of
this container.
|
void |
addFinalSpacing(int spacing)
Add final spacing to this label field panel of at least the specified
number of pixels, that is spacing that stretches vertically to cover
space left at the bottom of this container.
|
void |
addLabel(JLabel label)
Add the specified label to this label field panel.
|
void |
addLabel(String text)
Add the specified label to this label field panel.
|
void |
addSpacing(int spacing)
Add spacing to this label field panel of at least the specified
number of pixels.
|
float |
getFieldPercent()
Return the percentage of the width of this label field panel to
use for fields.
|
float |
getLabelPercent()
Return the percentage of the width of this label field panel to
use for labels.
|
void |
setFieldPercent(float fieldPercent)
Set the percentage of the width of this label field panel to use
for fields to
fieldPercent . |
void |
setLabelPercent(float labelPercent)
Set the percentage of the width of this label field panel to
use for labels to
labelPercent . |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public final float getLabelPercent()
public final void setLabelPercent(float labelPercent)
labelPercent
. The
sum of the label and field percentages must be less
than 1.0f
.labelPercent
- the percentage of the width of this label field panel
to use for labels, must be >= 0.0f
and <= 1.0f
public final float getFieldPercent()
public final void setFieldPercent(float fieldPercent)
fieldPercent
. The sum of
the label and field percentages must be less than or
equal to 1.0f
.fieldPercent
- the percentage of the width of this label field panel
to use for fields, must be >= 0.0f
and <= 1.0f
public final void addLabel(String text)
text
- label textpublic final void addLabel(JLabel label)
label
- label to add, must not be nullpublic final void addField(JComponent field)
field
- field to add, must not be nullpublic final void addField(String labelText, String fieldText)
labelText
- label textfieldText
- field textpublic final void addField(String text, JComponent field)
text
- label textfield
- field to add, must not be nullpublic final void addField(JLabel label, JComponent field)
label
- label to add, must not be nullfield
- field to add, must not be nullpublic final void addSpacing(int spacing)
spacing
- number of pixels, must be >= 0
public final void addFinalSpacing()
IllegalStateException
- if a final component has already been
added to this label field panelpublic final void addFinalSpacing(int spacing)
spacing
- minimum number of pixels, must be >= 0
IllegalStateException
- if a final component has already been
added to this label field panelpublic final void addFinalField(JComponent field)
field
- field to add, must not be nullIllegalStateException
- if a final component has already been
added to this label field panelCopyright (c) 2003-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).