JOptionPane.
BasicMessagePaneUI provides a means to place an icon,
message and buttons into a Container.
Generally, the layout will look like:
------------------
| i | message |
| c | message |
| o | message |
| n | message |
------------------
| buttons |
|________________|
icon is an instance of Icon that is wrapped inside a
JLabel. The message is an opaque object and is tested
for the following: if the message is a Component it is
added to the Container, if it is an Icon
it is wrapped inside a JLabel and added to the
Container otherwise it is wrapped inside a JLabel.
The above layout is used when the option pane's
ComponentOrientation property is horizontal, left-to-right.
The layout will be adjusted appropriately for other orientations.
The Container, message, icon, and buttons are all
determined from abstract methods.
| Modifier and Type | Class and Description |
|---|---|
| private static class | BasicOptionPaneUI.
Registered in the ActionMap. |
| public class | BasicOptionPaneUI.
This class should be treated as a "protected" inner class. |
| public static class | BasicOptionPaneUI.
|
| private static class | BasicOptionPaneUI.
This class is used to create the default buttons. |
| private class | |
| private static class | BasicOptionPaneUI.
A JTextField that allows you to specify an array of KeyStrokes that that will have their bindings processed regardless of whether or not they are registered on the JTextField. |
| public class | BasicOptionPaneUI.
This class should be treated as a "protected" inner class. |
| Modifier and Type | Field and Description |
|---|---|
| private BasicOptionPaneUI. | |
| protected boolean | hasCustomComponents
This is set to true in validateComponent if a Component is contained in either the message or the buttons. |
| protected Component | initialFocusComponent
Component to receive focus when messaged with selectInitialValue. |
| protected JComponent | inputComponent
JComponent provide for input if optionPane.getWantsInput() returns true. |
| public static final int | MinimumHeight
The minimum height of |
| protected Dimension | minimumSize
The size of |
| public static final int | MinimumWidth
The minimum width of |
| private static String | |
| protected JOptionPane | optionPane
|
| protected PropertyChangeListener | propertyChangeListener
The instance of |
| private static int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addButtonComponents(Container
a container container, Object[] an array of buttons buttons, int an initial index initialIndex)Creates the appropriate object to represent each of the objects in
|
| protected void | |
| protected void | addMessageComponents(Container
a container container, GridBagConstraints an instance of cons, Object GridBagConstraintsa message msg, int a maximum length maxll, boolean true if the component was internally createdCreates the appropriate object to represent |
| protected void | burstStringInto(Container
a container c, String a text d, int a maximum length of a text maxll)Recursively creates new |
| private void | configureButton(JButton button)
Configures any necessary colors/fonts for the specified button used representing the button portion of the optionpane. |
| private void | configureMessageLabel(JLabel label)
Configures any necessary colors/fonts for the specified label used representing the message. |
| public boolean | containsCustomComponents(JOptionPane op)
Implements abstract javax. Returns true if in the last call to validateComponent the message or buttons contained a subclass of Component. |
| protected ActionListener | Returns: a new instance of aButtonActionListeneran index of the button buttonIndex)Constructs a new instance of a |
| protected Container | Returns: aContainer containing the buttonsCreates and returns a |
| protected LayoutManager | |
| protected Container | Returns: a instance ofContainerMessaged from |
| protected PropertyChangeListener | Returns: an instance ofPropertyChangeListenerReturns an instance of |
| protected Container | |
| public static ComponentUI | Returns: a newBasicOptionPaneUI instancethe component x)Hides javax. Creates a new |
| protected Object[] | Returns: the buttons to display from the JOptionPaneReturns the buttons to display from the |
| private BasicOptionPaneUI. | |
| protected Icon | Returns: the iconReturns the icon from the |
| protected Icon | Returns: the icon to use for the passed in typea type of message messageType)Returns the icon to use for the passed in type. |
| protected int | Returns: the initial index into the buttons to selectReturns the initial index into the buttons to select. |
| pack-priv InputMap | |
| protected int | Returns: the maximum number of characters to place on a lineReturns the maximum number of characters to place on a line. |
| protected Object | Returns: the message to displayReturns the message to display from the |
| public Dimension | Returns: the minimum size of the option paneReturns the minimum size the option pane should be. |
| private int | |
| public Dimension | getPreferredSize(JComponent c)
Overrides javax. If |
| protected boolean | Returns: true if all the buttons should have the same widthReturns |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public void | installUI(JComponent c)
Overrides javax. Installs the receiver as the L&F for the passed in
|
| pack-priv static void | |
| protected void | resetInputValue()
Sets the input value in the option pane the receiver is providing the look and feel for based on the value in the inputComponent. |
| public void | selectInitialValue(JOptionPane op)
Implements abstract javax. If inputComponent is non-null, the focus is requested on that, otherwise request focus on the default value |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public void | uninstallUI(JComponent c)
Overrides javax. Removes the receiver from the L&F controller of the passed in split pane. |