|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagejavax.swingas colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
This class provides default implementations for the JFCActioninterface. Standard behaviors like the get and set methods forActionobject properties (icon text and enabled) are defined here. The developer need only subclass this abstract class and define theactionPerformedmethod.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.41 0246 12/0203/0001 @author Georges Saab @see Action
Defines common behaviors for buttons and menu items. For further information see How to Use Buttons Check Boxes and Radio Buttons a section in The Java Tutorial.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.133 02153 12/0903/01 @author Jeff Dinkins
This class implements accessibility support for theAbstractButtonclass. It provides an implementation of the Java Accessibility API appropriate to button and menu item user-interface elements.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder
ExtendsChangeListenerto be serializable.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder
Factory method which sets theClass AbstractButton, void fireActionPerformed(ActionEvent)ActionEventsource's properties according to values from theActioninstance. The properties which are set may differ for subclasses. By default the properties which get set areText Icon Enabled ToolTipText ActionCommandandMnemonic.If the
Actionpassed in isnullthe following things will occur:@param a the
- the text is set to
null- the icon is set to
null- enabled is set to true
- the tooltip text is set to
nullActionfrom which to get the properties ornull@since 1.3 @see Action @see #setAction
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using theClass AbstractButton, void fireItemStateChanged(ItemEvent)parameters passed into the fireeventmethodparameter. @parameevent theActionEventobject @see EventListenerList
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using theClass AbstractButton, void fireStateChanged()parameters passed into the fireeventmethodparameter. @param event theItemEventobject @see EventListenerList
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily createdClass AbstractButton, Icon getDisabledSelectedIcon()using the parameters passed into the fire method. @see EventListenerList
Returns the icon used by the button when it's disabled and selected. If not no disabled selection icon has been set the button constructs one from the selection icon. <-- PENDING(jeff): the disabled selection icon really should be created (ifClass AbstractButton, int getHorizontalTextPosition()necesarynecessary) by the L&F. --> @return thedisabledSelectedIconproperty @see #getPressedIcon @see #setDisabledIcon
Returns the horizontal position of the text relative to the icon. @return theClass AbstractButton, boolean isBorderPainted()horizontalTextPositionproperty one of the following values:
- SwingConstants.RIGHT
(the default)- SwingConstants.LEFT
- SwingConstants.CENTER
- SwingConstants.LEADING
- SwingConstants.TRAILING (the default)
Class AbstractButton, boolean isContentAreaFilled()ReturnsGetswhethertheborder shouldborderPaintedbe paintedproperty. @returntrue iftheborder shouldvaluebe paintedof thefalseborderPaintedotherwiseproperty @see #setBorderPainted
Class AbstractButton, boolean isFocusPainted()ChecksGetswhether the "content area" ofthebutton should becontentAreaFilledfilledproperty. @return thecontentAreaFilledproperty @see #setFocusPaintedsetContentAreaFilled
Class AbstractButton, boolean isFocusTraversable()ReturnsGetswhether focus shouldthebepaintFocuspaintedproperty. @return thepaintFocusproperty @see #setFocusPainted
Class AbstractButton, boolean isRolloverEnabled()IdentifiesReturns whetheror notthiscomponentComponentcanreceivebecome the focus owner. @returntrueif thiscomponentComponentcanisreceivefocusable;thefalsefocusotherwise @see #setFocusable @since JDK1.1 @deprecated As of 1.4 replaced byisFocusable().
Class AbstractButton, void paintBorder(Graphics)ChecksGetswhether rollover effectsthearerolloverEnabledenabledproperty. @return the value of therolloverEnabledproperty @see #setFocusPaintedsetRolloverEnabled
Paint the button's border ifClass AbstractButton, void setBorderPainted(boolean)BorderPaintedproperty is true and the button has a border. @param g theGraphicscontext in which to paint @see #paint @see #setBorder
SetsClass AbstractButton, void setContentAreaFilled(boolean)whethertheborderPaintedproperty. Iftrueand the button has a bordershould bethe border is painted. The default value for theborderPaintedproperty istrue. @param b if true and border property is notnullthe border is painted.@see #isBorderPainted @beaninfo bound: true attribute: visualUpdate true description: Whether the border should be painted.
SetsClass AbstractButton, void setFocusPainted(boolean)whetherthecontentAreaFilledproperty. Iftruethe buttonshouldwill paint the content areaor leave it transparent. If you wish to have a transparent buttonfor example andsuch as an icon only button for example then you should set this tofalse. Do not callsetOpaque(false).Whether theThe defaultbuttonvalue forfollowsthe theRepaintManagercontentAreaFilled's concept ofopacityproperty isL&F depandanttrue.This function may cause the component's opaque property to change.
The exact behavior of calling this function varies on a component-by-component and L&F-by-L&F basis. @param b if true
rollover effectsthe content should bepaintedfilled; if false the content area is not filled @see #isContentAreaFilled @see #setOpaque @beaninfo bound: true attribute: visualUpdate true description: Whether the button should paint the content area or leave it transparent.
SetsClass AbstractButton, void setHorizontalTextPosition(int)whetherthepaintFocusproperty which must betruefor the focusshouldstate to be painted. The default value for thepaintFocusproperty istrue. Some look and feels might not paint focus state; they will ignore this property. @param b iftruethe focus stateisshould be painted @see #isFocusPainted @beaninfo bound: true attribute: visualUpdate true description: Whether focus should be painted
Sets the horizontal position of the text relative to the icon. @param textPosition one of the following values:Class AbstractButton, void setMnemonic(char)@exception IllegalArgumentException if
- SwingConstants.RIGHT
(the default)- SwingConstants.LEFT
- SwingConstants.CENTER
- SwingConstants.LEADING
- SwingConstants.TRAILING (the default)
textPositionis not one of the legal values listed above @beaninfo bound: true enum: LEFT SwingConstants.LEFT CENTER SwingConstants.CENTER RIGHT SwingConstants.RIGHT LEADING SwingConstants.LEADING TRAILING SwingConstants.TRAILING attribute: visualUpdate true description: The horizontal position of the text relative to the icon.
Class AbstractButton, void setMnemonic(int)SpecifiesThis method is now obsolete please usesetMnemonic(int)to set the mnemonicvaluefor a button. This method is only designed to handle character values which fall between 'a' and 'z' or 'A' and 'Z'. @param mnemonic a char specifying the mnemonic value @see #setMnemonic(int) @beaninfo bound: true attribute: visualUpdate true description: the keyboard character mnemonic
Sets the keyboard mnemonic on the current model. The mnemonic is the key which when combined with the look and feel's mouseless modifier (usually Alt) will activate this button if focus is contained somewhere within this button's ancestor window.Class AbstractButton, void setRolloverEnabled(boolean)A mnemonic must correspond to a single key on the keyboard and should be specified using one of the
VK_XXXkeycodes defined injava.awt.event.KeyEvent. Mnemonics are case-insensitive therefore a key event with the corresponding keycode would cause the button to be activated whether or not the Shift modifier was pressed.If the character defined by the mnemonic is found within the button's label string the first occurrence of it will be underlined to indicate the mnemonic to the user. If the corresponding character is not contained within the button's label then it will be displayed near the label in a look and feel dependent manner (commonly to the right surrounded by parenthesis).
@param mnemonic the key code which represents the mnemonic @see java.awt.event.KeyEvent @beaninfo bound: true attribute: visualUpdate true description: the keyboard character mnemonic
SetsClass AbstractButton, void setUI(ButtonUI)whethertherolloverEnabledproperty which must betruefor rollover effectsshouldtobeoccur.enabledThe default value for therolloverEnabledproperty isfalse. Some look and feels might not implement rollover effects; they will ignore this property. @param b iftruerollover effects should be painted @see #isRolloverEnabled @beaninfo bound: true attribute: visualUpdate true description: Whether rollover effects should be enabled.
Sets the L&F object that renders this component. @param ui the ButtonUI L&F object @see #getUI @beaninfo bound: true hidden: true attribute: visualUpdate true description: The UI object that implements the LookAndFeel.
Class AbstractButton, void updateUI()Class AbstractButton, String CONTENT_AREA_FILLED_CHANGED_PROPERTYNotificationResetsfromtheUIFactoryUI propertythatto a value from theL&Fcurrent lookhas changedand feel. Subtypes ofAbstractButtonshould override this to update the UI. For exampleJButtonmight do the following:setUI((ButtonUI)UIManager.getUI( "ButtonUI" "javax.swing.plaf.basic.BasicButtonUI" this));
Identifies a changeClass AbstractButton, String ROLLOVER_ENABLED_CHANGED_PROPERTYfrom rollovertoenabled to disabled or back to enabledhaving the button paint the content area.
Identifies a changein thefrom rolloverbutton'senabled to disabled or back to enabled.
@version 1.4 028 12/0203/0001 A base class forCellEditorsproviding default implementations for the methods in theCellEditorinterface exceptgetCellEditorValue(). Like the other abstract implementations in Swing also manages a list of listeners.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A future releaseAs ofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @author Philip Milne
TheClass AbstractListModel, void addListDataListener(ListDataListener)Abstractabstract definition for the data modelthethat provides aListwith its contents.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A future releaseAs ofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.22 0230 12/0203/0001 @author Hans Muller
Class AbstractListModel, void fireContentsChanged(Object, int, int)AddAdds a listener to the list that's notified each time a change to the data model occurs. @param l theListDataListenerto be added
Class AbstractListModel, void fireIntervalAdded(Object, int, int)AbstractListModelsubclasses must call this method after one or more elements of the list change. The changed elements are specified byathe closed interval index0 index1i.e.-- therange that includes both index0endpointsand index1are included. Note that index0 need not be less than or equal to index1. @param sourceThetheListModelthat changed typically "this".@param index0Oneone end of the new interval.@param index1Thethe other end of the new interval.@see EventListenerList @see DefaultListModel
Class AbstractListModel, void fireIntervalRemoved(Object, int, int)AbstractListModelsubclasses must call this method after one or more elements are added to the model. The new elements are specified by a closed interval index0 index1i.e.-- therange that includesenpointsboth index0 andareindex1included. Note that index0 need not be less than or equal to index1. @param sourceThetheListModelthat changed typically "this".@param index0Oneone end of the new interval.@param index1Thethe other end of the new interval.@see EventListenerList @see DefaultListModel
Class AbstractListModel, EventListener[] getListeners(Class)AbstractListModelsubclasses must call this method after one or more elements are removed from the model. The new elements are specified by a closed interval index0 index1 i.e. the range that includes both index0 and index1. Note that index0 need not be less than or equal to index1. @param sourceThethe ListModel that changed typically "this".@param index0Oneone end of the new interval.@param index1Thethe other end of the new interval.@see EventListenerList @see DefaultListModel
Class AbstractListModel, void removeListDataListener(ListDataListener)ReturnReturns an array of all the objects currently registered asFooListeners upon this model.FooListeners are registered using theaddFooListenermethod.You can specify the
listenerslistenerTypeargument with a class literal such asFooListener.class. For example you can query a list modelmfor its list dataofwith thegivenfollowingtypecode:thatListDataListener[] ldls = (ListDataListener[])(m.getListeners(ListDataListener.class));wereIfaddedno suchtolisteners exist thismodelmethod returns an empty array. @returnsparamalllistenerType the type ofthelisteners requested; this parameter should specify an interface that descends fromjava.util.EventListener@return an array of all objectsrecievingregistered aslistenerTypeFooListenersnotificationsonfromthis model or an empty array if no such listeners have been added @exception ClassCastException iflistenerTypedoesn't specify a class or interface that implementsjava.util.EventListener@see #getListDataListeners @since 1.3
RemoveRemoves a listener from the list that's notified each time a change to the data model occurs. @param l theListDataListenerto be removed
TheClass Action, String ACCELERATOR_KEYActioninterface provides a useful extension to theActionListenerinterface in cases where the same functionality may be accessed by several controls.In addition to the
actionPerformedmethod defined by theActionListenerinterface this interface allows the application to define in a single place:Certain containers including menus and tool bars know how to add an
- One or more text strings that describe the function. These strings can be used for example to display the flyover text for a button or to set the text in a menu item.
- One or more icons that depict the function. These icons can be used for the images in a menu control or for composite entries in a more sophisticated user interface.
- The enabled/disabled state of the functionality. Instead of having to separately disable the menu item and the toolbar button the application can disable the function that implements this interface. All components which are registered as listeners for the state change then know to disable event generation for that item and to modify the display accordingly.
Actionobject. When anActionobject is added to such a container the container:For example both a menu item and a toolbar button could access a
- Creates a component that is appropriate for that container (a tool bar creates a button component for example).
- Gets the appropriate property(s) from the
Actionobject to customize the component (for example the icon image and flyover text).- Checks the
intialinitial state of theActionobject to determine if it is enabled or disabled and renders the component in the appropriate fashion.- Registers a listener with the
Actionobject so that is notified of state changes. When theActionobject changes from enabled to disabled or back the container makes the appropriate revisions to the event-generation mechanisms and renders the component accordingly.Cutaction object. The text associated with the object is specified as "Cut" and an image depicting a pair of scissors is specified as its icon. TheCutaction-object can then be added to a menu and to a tool bar. Each container does the appropriate things with the object and invokes itsactionPerformedmethod when the component associated with it is activated. The application can then disable or enable the application object without worrying about what user-interface components are connected to it.This interface can be added to an existing class or used to create an adapter (typically by subclassing
AbstractActio). TheActionobject can then be added to multiple action-aware containers and connected to Action-capable components. The GUI controls can then be activated or deactivated all at once by invoking theActionobject'ssetEnabledmethod.Note that
Actionimplementations tend to be more expensive in terms of storage than a typicalActionListenerwhich does not offer the benefits of centralized control of functionality and broadcast of property changes. For th is reason you should take care to only useActions where their benefits are desired and use simpleActionListenerselsewhere. @version 1.21240212/0203/0001 @author Georges Saab @see AbstractAction
The key used for storing a KeyStroke to be used as the accelerator for the action. @since 1.3
Class Action, String MNEMONIC_KEYThe key used for storing an int key code to be used as the mnemonic for the action. @since 1.3
ActionMapprovides mappings fromObjects (called keys orActionnames) toActions. AnActionMapis usually used with anInputMapto locate a particular action when a key is pressed. As withInputMapanActionMapcan have a parent that is searched for keys not defined in theActionMap.As with
InputMapif you create a cycle eg:ActionMap am = new ActionMap(); ActionMap bm = new ActionMap(): am.setParent(bm); bm.setParent(am);some of the methods will cause a StackOverflowError to be thrown. @see InputMap @version 1.8 0211 12/0203/0001 @author Scott Violet
Factory class for vending standardClass BorderFactory, TitledBorder createTitledBorder(Border)Borderobjects. Wherever possible this factory will hand out references to sharedBorderinstances. For further information and examples see How to Use Borders a section in The Java Tutorial. @version 1.23 0225 12/0203/0001 @author David Kloba
Creates a new title border with an empty title specifying the border object using the default text position (sitting on the top line) and default justification (leading) and using the default font and text color.and@param borderdetermined bythecurrent lookBorderandobjectfeel.to(TheaddMotif and Windows look and feelsthe title to if null theuseBorderan etchedis determinedborder;byThe Javathe current look and feeluses a gray border.)@paramborder thetitle aBorderStringobject to addcontaining the text of the titleto@return theTitledBorderobject
Defines the data model used by components like Sliders and ProgressBars. Defines four interrelated integer properties: minimum maximum extent and value. These four integers define two nested ranges like this:Class BoundedRangeModel, void setRangeProperties(int, int, int, int, boolean)minimum < value < value+extent < maximumThe outer range isminimum maximumand the inner range isvalue value+extent. The inner range must lie within the outer one i.e.valuemust be less than or equal tomaximumandvalue+extentmust greater than or equal tominimumandmaximummust be greater than or equal tominimum. There are a few features of this model that one might find a little surprising. These quirks exist for the convenience of the Swing BoundedRangeModel clients like like Slider and ScrollBar.
- The minimum and maximum set methods "correct" the other three properties to
acommodateaccommodate their new value argument. For example setting the model's minimum may change its maximum value and extent properties (in that order) to maintain the constraints specified above.- The value and extent set methods "correct" their argument to fit within the limits defined by the other three properties. For example if
value == maximumsetExtent(10)would change the extent (back) to zero.- The four BoundedRangeModel values are defined as Java Beans properties however Swing ChangeEvents are used to notify clients of changes rather than PropertyChangeEvents. This was done to keep the overhead of monitoring a BoundedRangeModel low. Changes are often reported at MouseDragged rates.
For an example of specifying custom bounded range models used by sliders see The Anatomy of a Swing-Based Program in The Java Tutorial. @version 1.
22240212/0203/0001 @author Hans Muller @see DefaultBoundedRangeModel
This method sets all of the model's data with a single method call. The method results in a single change event being generated. This is convenient when you need to adjust all the model datasimulaneouslysimultaneously and do not want individual change events to occur. @param value an int giving the current value @param extent an int giving the amount by which the value can "jump" @param min an int giving the minimum value @param max an int giving the maximum value @param isAdjusting a boolean true if a series of changes are in progress @see #setValue @see #setExtent @see #setMinimum @see #setMaximum @see #setValueIsAdjusting
A lightweight container that uses a BoxLayout object as its layout manager. Box provides several class methods that are useful for containers using BoxLayout -- even non-Box containers.The Box class can create several kinds of invisible components that affect layout: glue struts and rigid areas. If all the components your Box contains have a fixed size you might want to use a glue component (returned by
createGlue) to control the components' positions. If you need a fixed amount of space between two components try using a strut (createHorizontalStrutorcreateVerticalStrut). If you need an invisible component that always takes up the same amount of space get it by invokingcreateRigidArea.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A futureAsreleaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @see BoxLayout @author Timothy Prinzing @version 1.36 0837 12/0503/0001
An implementation of a lightweight component that participates in layout but has no view.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder
A layout manager that allows multiple components to beClass BoxLayout, constructor BoxLayout(Container, int)layedlaid out either vertically or horizontally. The components will not wrap so for example a vertical arrangement of components will stay vertically arranged when the frame is resized.
![]()
Nesting multiple panels with different combinations of horizontal and vertical gives an effect similar to GridBagLayout without the complexity. The diagram shows two panels arranged horizontally each of which contains 3 components arranged vertically.
The
Box container usesBoxLayout(unlikemanagerJPanel which defaults to flowis constructed with an axislayout).parameterYou can nest multiple boxes and add components tothat specifies the type of layout that will bethemdone.to get theThere are fourarrangementchoices:youX_AXISwant.-The BoxLayout manager that places each ofComponents are laid out horizontally from left toitsright.managedY_AXIScomponents from left to right or- Components are laid out vertically from top to bottom.WhenLINE_AXISyou- Components are laid out the way words arecreatelaid out in aBoxLayout you specify whetherline based on theitscontainer'smajorComponentOrientationaxisproperty.isIf theXcontainer'saxisComponentOrientation(whichismeanshorizontal then components are laid out horizontally otherwise they are laid out vertically. For horizontal orientations if the container's ComponentOrientation is left to rightplacement)thenor Y axiscomponents are laid(topout left tobottomrightplacement).otherwiseComponentsthey arearrangedlaidfrom leftout right torightleft.(orFor vertical orientations components are always laid out from top to bottom).inPAGE_AXIS - Components are laid out thesame order as they were addedway text lines are laid outtoon a page based on the container's ComponentOrientation property.InsteadIf theofcontainer'susingComponentOrientationBoxLayout directly many programs use the Boxis horizontal then components are laid outclass.verticallyThe Box class provides aotherwise they are laid outlightweighthorizontally. For horizontal orientations if the container'sthatComponentOrientationuses ais leftBoxLayoutto right then components are laid out left to right otherwise they are laid out right to left.Box also provides handyFor vertical orientations componentsmethodsare always laid out from top tohelpbottom.you use BoxLayoutFor all
welldirections components are arranged in the same order as they were added to the container.BoxLayout attempts to arrange components at their preferred widths (for
left to righthorizontal layout) or heights (fortop to bottomvertical layout). For aleft to righthorizontal layout if not all the components are the same height BoxLayout attempts to make all the components as high as the highest component. If that's not possible for a particular component then BoxLayout aligns that component vertically according to the component's Y alignment. By default a component hasana Y alignment of 0.5 which means that the vertical center of the component should have the same Y coordinate as the vertical centers of other components with 0.5 Y alignment.Similarly for a vertical layout BoxLayout attempts to make all components in the column as wide as the widest component
;.ifIf that fails it aligns them horizontally according to their X alignments. ForPAGE_AXISlayout horizontal alignment is done based on the leading edge of the component. In other words an X alignment value of 0.0 means the left edge of a component if the container'sComponentOrientationis left to right and it means the right edge of the component otherwise.Instead of using BoxLayout directly many programs use the Box class. The Box class is a lightweight container that uses a BoxLayout. It also provides handy methods to help you use BoxLayout well. Adding components to multiple nested boxes is a powerful way to get the arrangement you want.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A future releaseAs ofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @see Box @seeComponentjava.awt.ComponentOrientation @see JComponent#getAlignmentX @seeComponentJComponent#getAlignmentY @author Timothy Prinzing @version 1.25290312/0203/01
Creates a layout manager that will lay out componentseither left to right or top to bottom as specified inalong theaxisgivenparameteraxis. @param target the container that needs to be laid out @param axis the axis to lay out components along.ForCanleft-to-rightbelayoutonespecifyof:BoxLayout.X_AXIS; fortop-to-bottomBoxLayout.Y_AXISlayoutBoxLayout.LINE_AXISspecifyorBoxLayout.@exception AWTError if the value ofYPAGE_AXISaxisis invalid
This class is used to create a multiple-exclusion scope for a set of buttons. Creating a set of buttons with the sameClass ButtonGroup, constructor ButtonGroup()ButtonGroupobject means that turning "on" one of those buttons turns off all other buttons in the group.A
ButtonGroupcan be used with any set of objects that inherit fromAbstractButton. Typically a button group contains instances ofJRadioButtonJRadioButtonMenuItemorJToggleButton. It wouldn't make sense to put an instance ofJButtonorJMenuItemin a button group becauseJButtonandJMenuItemdon't implement the selected state.Initially all buttons in the group are unselected. Once any button is selected one button is always selected in the group. There is no way to turn a button programmatically to "off" in order to clear the button group. To give the appearance of "none selected" add an invisible radio button to the group and then programmatically select that button to turn off all the displayed radio buttons. For example a normal button with the label "none" could be wired to select the invisible radio button.
For examples and further information on using button groups see How to Use Radio Buttons a section in The Java Tutorial.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A futureAsreleaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.27 0232 12/0203/0001 @author Jeff Dinkins
Creates a new ButtonGroup.
Class ButtonGroup, void add(AbstractButton)Adds the button to the group. @param b the button to be addedClass ButtonGroup, int getButtonCount()
Returns the number of buttons in the group. @return the button countClass ButtonGroup, Enumeration getElements()
Class ButtonGroup, ButtonModel getSelection()ReturnReturns all the buttons that are participating in this group. @return anEnumerationof the buttons in this group
Class ButtonGroup, boolean isSelected(ButtonModel)ReturnReturns the model of the selected button. @return the selected button model.
ReturnsClass ButtonGroup, void remove(AbstractButton)thewhether aButtonModelis selected. @returnvaluetrueforif the button.is selected otherwise returnsfalse
Removes the button from the group. @param b the button to be removedClass ButtonGroup, void setSelected(ButtonModel, boolean)
Sets the selected value for theButtonModel. Only one button in the group may be selected at a time. @param theButtonModel@paramtrueif this button is to be selected otherwisefalse
State Model for buttons. This model is used for check boxes and radio buttons which are special kinds of buttons as well as for normal buttons. For check boxes and radio buttons pressing the mouse selects the button. For normal buttons pressing the mouse "arms" the button. Releasing the mouse over the button then initiates a button press firing its action event. Releasing the mouse elsewhere disarms the button.In use a UI will invoke #setSelected when a mouse click occurs over a check box or radio button. It will invoke #setArmed when the mouse is pressed over a regular button and invoke #setPressed when the mouse is released. If the mouse travels outside the button in the meantime
setArmed(false)will tell the button not to fire when it seessetPressed. (If the mouse travels back in the button will be rearmed.)Note:@version 1.
A button is triggered when it is both "armed" and "pressed".23 0224 12/0203/0001 @author Jeff Dinkins
This interface defines the methods any general editor should be able to implement.Class CellEditor, void addCellEditorListener(CellEditorListener)Having this interface enables complex components (the client of the editor) such as
JListJTreeandJTableto allow any generic editor to edit values in a table cell or tree cell etc. Without this generic editor interfaceJTablewould have to know about specific editors such asJTextFieldJCheckBoxJComboBoxetc. In addition without this interface clients of editors such asJTablewould not be able to work with any editors developed in the future by the user or a 3rd party ISV.To use this interface a developer creating a new editor can have the new component implement the interface. Or the developer can choose a wrapper based
approchapproach and provide a companion object which implements theCellEditorinterface (SeeJCellEditorfor example). The wrapperapprochapproach is particularly useful if the user want to use a 3rd party ISV editor withJTablebut the ISV didn't implement theCellEditorinterface. The user can simply create an object that contains an instance of the 3rd party editor object and "translate" theCellEditorAPI into the 3rd party editor's API. @see javax.swing.event.CellEditorListener @version 1.19 0222 12/0203/0001 @author Alan Chung
Class CellEditor, void cancelCellEditing()AddAdds a listener to the list that's notified when the editorstartsstops or cancels editing. @param l the CellEditorListener
Class CellEditor, Object getCellEditorValue()TellTells the editor to cancel editing and not accept any partially edited value.
Returns the value contained in the editor. @return the value contained in the editorClass CellEditor, boolean isCellEditable(EventObject)
Class CellEditor, void removeCellEditorListener(CellEditorListener)AskAsks the editor if it can start editing usinganEvent.anEventis in the invoking component coordinate system. The editor can not assume the Component returned bygetCellEditorComponentis installed. This method is intended for the use of client to avoid the cost of setting up and installing the editor component if editing is not possible. If editing can be started this method returns true. @param anEvent the event the editor should use to consider whether to begin editing or not().@return true if editing can be started.@see #shouldSelectCell
Class CellEditor, boolean shouldSelectCell(EventObject)RemoveRemoves a listener from the list that's notified @param l the CellEditorListener
Class CellEditor, boolean stopCellEditing()TheReturnsreturn value of shouldSelectCell() is a boolean indicatingtruewhetherif the editing cell should be selectedorfalsenototherwise. Typically the return value is true because is most cases the editing cell should be selected. However it is useful to return false to keep the selection from changing for some types of edits. eg. A table that contains a column of check boxes the user might want to be able to change those checkboxes without altering the selection. (See Netscape Communicator for just such an example) Of course it is up to the client of the editor to use the return value but it doesn't need to if it doesn't want to. @param anEvent the event the editor should use to start editing.@return true if the editor would like the editing cell to be selected; otherwise returns false @see #isCellEditable
TellTells the editor to stop editing and accept any partially edited value as the value of the editor. The editor returns false if editing was not stopped; this is useful for editorswhich validatesthat validate and can not accept invalid entries. @return true if editing was stopped; false otherwise
This class is inserted in between cell renderers and the components that use them. It just exists to thwart the repaint() and invalidate() methods which would otherwiseClass CellRendererPane, void invalidate()propogatepropagate up the tree when the renderer was configured. It's used by the implementations of JTable JTree and JList. For example here's how CellRendererPane is used in the code the paints each row in a JList:cellRendererPane = new CellRendererPane(); ... Component rendererComponent = renderer.getListCellRendererComponent(); renderer.configureListCellRenderer(dataModel.getElementAt(row) row); cellRendererPane.paintComponent(g rendererComponent this x y w h);A renderer component must override isShowing() and unconditionally return true to work correctly because the Swing paint does nothing for components with isShowing false.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A future releaseAs ofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.34 0836 12/0503/0001 @author Hans Muller
Overridden to avoidClass CellRendererPane, void paintComponent(Graphics, Component, Container, int, int, int, int, boolean)propogatingpropagating a invalidate up the tree when the cell renderer child is configured.
Paint a cell renderer component c on graphics object g. Before the component is drawn it's reparented to this (if that'sneccessarynecessary) it's bounds are set to w h and the graphics object is (effectively) translated to x y. If it's a JComponent double buffering is temporarily turned off. After the component is painted it's bounds are reset to -w -h 0 0 so that if it's the last renderer component painted it will not start consuming input. The Container p is the component we're actually drawing on typically it's equal to this.getParent(). If shouldValidate is true the component c will be validated before painted.
The editor component used for JComboBox components. @version 1.10 0211 12/0203/0001 @author Arnaud Weber
Class ComboBoxModel, Object getSelectedItem()ComboBoxDataModelAisdata model for a combo box. This interface extendsListDataModel and adds the conceptwithof a selected item.ThisThe selected item is generally the item which is visible in themodel since itcombo box displayisarea.The selected item
may notalwaysnecessarilyinbe managed by the underlyingListModel. This disjoint behavior allows for the temporary storage and retrieval of a selected itemlistin the model. @version 1.13 12/03/01 @author Arnaud Weber
Class ComboBoxModel, void setSelectedItem(Object)ReturnReturns the selected item @return The selected item ornullif there is no selection
Set the selected item. The implementation of this method should notify all registeredListDataListeners that the contents have changed. @param anItem the list object to select ornullto clear the selection
AComponentInputMapis anInputMapassociated with a particularJComponent. The component is automatically notified whenever theComponentInputMapchanges.ComponentInputMaps are used forWHEN_IN_FOCUSED_WINDOWbindings. @version 1.6 027 12/0203/0001 @author Scott Violet
Graphics subclass supporting graphics debugging. Overrides most methods from Graphics. DebugGraphics objects are rarely created by hand. They are most frequently created automatically when a JComponent's debugGraphicsOptions are changed using the setDebugGraphicsOptions() method.Class DebugGraphics, int BUFFERED_OPTIONNOTE: You must turn off double buffering to use DebugGraphics: RepaintManager repaintManager = RepaintManager.currentManager(component); repaintManager.setDoubleBufferingEnabled(false); @see JComponent#setDebugGraphicsOptions @see RepaintManager#currentManager @see RepaintManager#setDoubleBufferingEnabled @version 1.
20 0722 12/2603/0001 @author Dave Karlton
Show buffered operations in aseperateseparateFrame.
A generic implementation of BoundedRangeModel.Class DefaultBoundedRangeModel, constructor DefaultBoundedRangeModel(int, int, int, int)Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A future releaseAs ofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.35 0242 12/0203/0001 @author David Kloba @author Hans Muller @see BoundedRangeModel
Initializes value extent minimum and maximum. Adjusting is false. Throws anClass DefaultBoundedRangeModel, void addChangeListener(ChangeListener)IllegalArgumentExceptionif the following constraints aren't satisfied:min < value < value+extent < max
Adds a ChangeListener. The change listeners are run each time any one of the Bounded Range model properties changes. @param l the ChangeListener to add @see #removeChangeListener @see BoundedRangeModel#addChangeListener
Class DefaultBoundedRangeModel, void fireStateChanged()Class DefaultBoundedRangeModel, int getExtent()RunRuns eachChangeListenersChangeListener'sstateChangedmethod. @see #setRangeProperties @see EventListenerList()
Class DefaultBoundedRangeModel, EventListener[] getListeners(Class)ReturnReturns the model's extent. @return the model's extent @see #setExtent @see BoundedRangeModel#getExtent
Class DefaultBoundedRangeModel, int getMaximum()ReturnReturns an array of all the objects currently registered asFooListeners upon this model.FooListeners are registered using theaddFooListenermethod.You can specify the
listenerslistenerTypeargument with a class literal such asFooListener.class. For example you can query aDefaultBoundedRangeModelinstancemfor its changeofwith thegivenfollowingtypecode:thatChangeListener[] cls = (ChangeListener[])(m.getListeners(ChangeListener.class));wereIfaddedno such listenerstoexist thismodelmethod returns an empty array. @returnsparamalllistenerType the type ofthelisteners requested; this parameter should specify an interface that descends fromjava.util.EventListener@return an array of all objectsrecievingregistered aslistenerTypeFooListenersnotificationsonfromthis model or an empty array if no such listeners have been added @exception ClassCastException iflistenerTypedoesn't specify a class or interface that implementsjava.util.EventListener@see #getChangeListeners @since 1.3
Class DefaultBoundedRangeModel, int getMinimum()ReturnReturns the model's maximum. @return the model's maximum @see #setMaximum @see BoundedRangeModel#getMaximum
Class DefaultBoundedRangeModel, int getValue()ReturnReturns the model's minimum. @return the model's minimum @see #setMinimum @see BoundedRangeModel#getMinimum
Class DefaultBoundedRangeModel, boolean getValueIsAdjusting()ReturnReturns the model's current value. @return the model's current value @see #setValue @see BoundedRangeModel#getValue
Returns true if the value is in the process of changing as a result of actions being taken by the user. @return the value of the valueIsAdjusting property @see #setValue @see BoundedRangeModel#getValueIsAdjusting
Class DefaultBoundedRangeModel, void removeChangeListener(ChangeListener)Removes aClass DefaultBoundedRangeModel, void setRangeProperties(int, int, int, int, boolean)ChangeListener. @param l theChangeListenerto remove @see #addChangeListener @see BoundedRangeModel#removeChangeListener
Sets all of theClass DefaultBoundedRangeModel, void setValueIsAdjusting(boolean)BoundedRangeModelproperties after forcing the arguments to obey the usual constraints:minimum < value < value+extent < maximumAt most one
ChangeEventis generated. @see BoundedRangeModel#setRangeProperties @see #setValue @see #setExtent @see #setMinimum @see #setMaximum @see #setValueIsAdjusting
Sets the valueIsAdjusting property. @see #getValueIsAdjusting @see #setValue @see BoundedRangeModel#setValueIsAdjusting
Class DefaultBoundedRangeModel, String toString()Returns a string that displays all of the BoundedRangeModel properties.
Class DefaultBoundedRangeModel, ChangeEvent changeEventOnly one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this".
The default implementation of aClass DefaultButtonModel, constructor DefaultButtonModel()Buttoncomponent's data model.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.32 0241 12/0203/0001 @author Jeff Dinkins
Constructs a default JButtonModel.
Class DefaultButtonModel, void addActionListener(ActionListener)Adds an ActionListener to the button. @param l the listener to add
Class DefaultButtonModel, void addChangeListener(ChangeListener)Adds a ChangeListener to the button. @param l the listener to add
Class DefaultButtonModel, void addItemListener(ItemListener)Adds an ItemListener to the button. @param l the listener to add
Class DefaultButtonModel, String getActionCommand()Returns the action command for this button. @return the String that identifies the generated event @see #setActionCommand
Class DefaultButtonModel, ButtonGroup getGroup()Returns the group that this button belongs to. Normally used with radio buttons which are mutually exclusive within their group. @return a ButtonGroup that this button belongs to @since 1.3
Class DefaultButtonModel, EventListener[] getListeners(Class)Class DefaultButtonModel, Object[] getSelectedObjects()ReturnReturns an array of all the objects currently registered asFooListeners upon this model.FooListeners are registered using theaddFooListenermethod.You can specify the
listenerslistenerTypeargument with a class literal such asFooListener.class. For example you can query aDefaultButtonModelinstancemfor its actionofwith thegivenfollowingtypecode:thatActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));were added toIf no such listeners exist thismodelmethod returns an empty array. @returns allparam listenerType the type ofthelisteners requested; this parameter should specify an interface that descends fromjava.util.EventListener@return an array of all objectsrecievingregistered aslistenerTypeFooListenersnotificationsonfromthis model or an empty array if no such listeners have been added @exception ClassCastException iflistenerTypedoesn't specify a class or interface that implementsjava.util.EventListener@see #getActionListeners @see #getChangeListeners @see #getItemListeners @since 1.3
Class DefaultButtonModel, boolean isEnabled()OverridenOverridden to returnnull.
IndicatesClass DefaultButtonModel, boolean isPressed()ifwhether the button can be selected or pressed by an input device (such as a mouse pointer). (Checkbox-buttons are selected regular buttons are "pressed".) @return true if the button is enabled and therefore selectable (or pressable)
IndicatesClass DefaultButtonModel, void removeActionListener(ActionListener)ifwhether button has been pressed. @return true if the button has been pressed
Removes an ActionListener from the button. @param l the listener to remove
Class DefaultButtonModel, void removeChangeListener(ChangeListener)Removes a ChangeListener from the button. @param l the listener to remove
Class DefaultButtonModel, void removeItemListener(ItemListener)Removes an ItemListener from the button. @param l the listener to remove
Class DefaultButtonModel, void setActionCommand(String)Sets theClass DefaultButtonModel, void setGroup(ButtonGroup)actionCommandstring that gets sent as part of the event when the button is pressed. @param s theStringthat identifies the generated event
Identifies the group this button belongs to -- needed for radio buttons which are mutually exclusive within their group. @param group the ButtonGroup this button belongs to
Class DefaultButtonModel, void setSelected(boolean)Selects or deselects the button. @param b true selects the button false deselects the buttonClass DefaultButtonModel, ChangeEvent changeEvent.
Only one ChangeEvent is needed per button model instance since the event's only state is the source property. The source of events generated is always "this".
The default editor for table and tree cells.Class DefaultCellEditor, constructor DefaultCellEditor(JCheckBox)Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.38 0246 12/0203/0001 @author Alan Chung @author Philip Milne
Constructs aClass DefaultCellEditor, constructor DefaultCellEditor(JComboBox)DefaultCellEditorobject that uses a check box. @param x aJCheckBoxobject...
Constructs aClass DefaultCellEditor, constructor DefaultCellEditor(JTextField)DefaultCellEditorobject that uses a combo box. @param x aJComboBoxobject...
Constructs aClass DefaultCellEditor, int getClickCountToStart()DefaultCellEditorthat uses a text field. @param x aJTextFieldobject...
Class DefaultCellEditor, Component getComponent()ClickCountToStartReturnscontrolsthe number of clicksrequiredneeded to start editing. @returns the number of clicks needed to start editing
Returnsthea reference to the editor component. @return the editorComponent
The default model for combo boxes. @version 1.11 0215 12/0203/0001 @author Arnaud Weber @author Tom Santos
This is anClass DefaultDesktopManager, void activateFrame(JInternalFrame)implementaionimplementation of theDesktopManager. It currently implementsathe basic behaviors for managingJInternalFramesJInternalFrames in an arbitrary parent.JInternalFramesJInternalFrames that are not children of aJDesktopwill use this component to handle their desktop-like actions. @see JDesktopPane @see JInternalFrame @version 1.41 0245 12/0203/0001 @author David Kloba @author Steve Wilson
This will activate f moving it to the front. It will set the current active frame's (if any)Class DefaultDesktopManager, void closeFrame(JInternalFrame)IS_SELECTED_PROPERTYtofalse. There can be only one active frame across all Layers. @param f theJInternalFrameto be activated
Removes the frame and if necessary theClass DefaultDesktopManager, void deiconifyFrame(JInternalFrame)desktopIconfrom its parent. @param f theJInternalFrameto be removed
Removes the desktopIcon from its parent and adds its frame to the parent. @param f the JInternalFrame to be de-iconified
Class DefaultDesktopManager, void dragFrame(JComponent, int, int)Moves the visible location of the frame being dragged to the location specified. The means by which this occurs can vary depending on the dragging algorithm being used. The actual logical location of the frame might not change until endDraggingFrame is called.
Class DefaultDesktopManager, void iconifyFrame(JInternalFrame)Removes the frame from its parent and adds itsClass DefaultDesktopManager, void maximizeFrame(JInternalFrame)desktopIconto the parent. @param f theJInternalFrameto be iconified
Resizes the frame to fill its parents bounds. @param the frame to be resizedClass DefaultDesktopManager, void minimizeFrame(JInternalFrame)
Restores the frame back to its size and position prior to aClass DefaultDesktopManager, void removeIconFor(JInternalFrame)maximizeFramecall. @param f the()JInternalFrameto be restored
Class DefaultDesktopManager, void resizeFrame(JComponent, int, int, int, int)ConvienceConvenience method to remove the desktopIcon of f is necessary.
Calls setBoundsForFrame() with the new values. @param f the component to be resized @param newX the new x-coordinate @param newY the new y-coordinate @param newWidth the new width @param newHeight the new height
Class DefaultDesktopManager, void setBoundsForFrame(JComponent, int, int, int, int)This moves the JComponent and repaints the damaged areas.