public class DateTimePicker extends JPanel
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
DatePicker |
datePicker
datePicker, This holds the date picker component of this DateTimePicker.
|
TimePicker |
timePicker
timePicker, This holds the time picker component of this DateTimePicker.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
DateTimePicker()
Constructor with default settings.
|
DateTimePicker(DatePickerSettings datePickerSettingsOrNull,
TimePickerSettings timePickerSettingsOrNull)
Constructor with custom settings.
|
Modifier and Type | Method and Description |
---|---|
void |
addDateTimeChangeListener(DateTimeChangeListener listener)
addDateTimeChangeListener, This adds a change listener to this DateTimePicker.
|
void |
clear()
clear, This will clear the date picker text and the time picker text.
|
int |
getBaseline(int width,
int height)
getBaseline, This returns the baseline value of the dateTextField of the date picker.
|
DatePicker |
getDatePicker()
getDatePicker, This returns the date picker component of this DateTimePicker.
|
ArrayList<DateTimeChangeListener> |
getDateTimeChangeListeners()
getDateTimeChangeListeners, This returns a new ArrayList, that contains any change listeners
that are registered with this DateTimePicker.
|
java.time.LocalDateTime |
getDateTimePermissive()
getDateTimePermissive, This attempts to retrieve the date from the date picker, and the time
from the time picker, and return a single LocalDateTime value.
|
java.time.LocalDateTime |
getDateTimeStrict()
getDateTimeStrict, This attempts to retrieve the date from the date picker, and the time from
the time picker, and return a single LocalDateTime value.
|
TimePicker |
getTimePicker()
getTimePicker, This returns the time picker component of this DateTimePicker.
|
boolean |
isDateTimeAllowed(java.time.LocalDateTime value)
isDateTimeAllowed, This checks to see if the specified value is allowed by any currently set
veto policies and "allowEmptyValues" settings of both the DatePicker and TimePicker
components.
|
boolean |
isEnabled()
isEnabled, Returns true if this component is enabled, otherwise returns false.
|
void |
removeDateTimeChangeListener(DateTimeChangeListener listener)
removeDateTimeChangeListener, This removes the specified change listener from this
DateTimePicker.
|
void |
setDateTimePermissive(java.time.LocalDateTime optionalDateTime)
setDateTimePermissive, This uses the supplied LocalDateTime to set the value of the
DatePicker and the TimePicker.
|
void |
setDateTimeStrict(java.time.LocalDateTime optionalDateTime)
setDateTimeStrict, This uses the supplied LocalDateTime to set the value of the DatePicker
and the TimePicker.
|
void |
setEnabled(boolean enabled)
setEnabled, This enables or disables the DateTimePicker.
|
void |
setGapSize(int gapSize,
ConstantSize.Unit units)
setGapSize, This sets the size of the gap between the date picker and the time picker.
|
String |
toString()
toString, This method is identical to the function toStringPermissive().
|
String |
toStringPermissive()
toStringPermissive, This returns a string representation of the values which are currently
stored in the date and time picker.
|
String |
toStringStrict()
toStringStrict, This returns a string representation of the values which are currently stored
in the date and time picker.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, hide, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, 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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
public DatePicker datePicker
public TimePicker timePicker
public DateTimePicker()
public DateTimePicker(DatePickerSettings datePickerSettingsOrNull, TimePickerSettings timePickerSettingsOrNull)
public void addDateTimeChangeListener(DateTimeChangeListener listener)
public void clear()
public int getBaseline(int width, int height)
getBaseline
in class JComponent
public DatePicker getDatePicker()
public void removeDateTimeChangeListener(DateTimeChangeListener listener)
public ArrayList<DateTimeChangeListener> getDateTimeChangeListeners()
public java.time.LocalDateTime getDateTimePermissive()
public java.time.LocalDateTime getDateTimeStrict()
public TimePicker getTimePicker()
public boolean isDateTimeAllowed(java.time.LocalDateTime value)
public boolean isEnabled()
public void setDateTimePermissive(java.time.LocalDateTime optionalDateTime)
public void setDateTimeStrict(java.time.LocalDateTime optionalDateTime)
public void setEnabled(boolean enabled)
setEnabled
in class JComponent
public void setGapSize(int gapSize, ConstantSize.Unit units)
public String toString()
String
, such as 2007-12-03T10:15:30
.
The output will be one of the following ISO-8601 formats:
uuuu-MM-dd'T'HH:mm
uuuu-MM-dd'T'HH:mm:ss
uuuu-MM-dd'T'HH:mm:ss.SSS
uuuu-MM-dd'T'HH:mm:ss.SSSSSS
uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSS
public String toStringPermissive()
String
, such as 2007-12-03T10:15:30
.
The output will be one of the following ISO-8601 formats:
uuuu-MM-dd'T'HH:mm
uuuu-MM-dd'T'HH:mm:ss
uuuu-MM-dd'T'HH:mm:ss.SSS
uuuu-MM-dd'T'HH:mm:ss.SSSSSS
uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSS
public String toStringStrict()
String
, such as 2007-12-03T10:15:30
.
The output will be one of the following ISO-8601 formats:
uuuu-MM-dd'T'HH:mm
uuuu-MM-dd'T'HH:mm:ss
uuuu-MM-dd'T'HH:mm:ss.SSS
uuuu-MM-dd'T'HH:mm:ss.SSSSSS
uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSS
Copyright © 2018. All rights reserved.