📄 package-summary.html
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="RepaintManager.html">RepaintManager</A></B></TD><TD>This class manages repaint requests, allowing the number of repaints to be minimized, for example by collapsing multiple requests into a single repaint for members of a component tree.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="ScrollPaneLayout.html">ScrollPaneLayout</A></B></TD><TD>The layout manager used by JScrollPane.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="ScrollPaneLayout.UIResource.html">ScrollPaneLayout.UIResource</A></B></TD><TD>The UI resource version of ScrollPaneLayout.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="SizeRequirements.html">SizeRequirements</A></B></TD><TD>For the convenience of layout managers, calculates information about the size and position of components.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="SizeSequence.html">SizeSequence</A></B></TD><TD>A <code>SizeSequence</code> object efficiently maintains an ordered list of sizes and corresponding positions.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="SwingUtilities.html">SwingUtilities</A></B></TD><TD>A collection of utility methods for Swing.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="Timer.html">Timer</A></B></TD><TD>Causes an action to occur at a predefined rate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="ToolTipManager.html">ToolTipManager</A></B></TD><TD>Manages all the ToolTips in the system.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="UIDefaults.html">UIDefaults</A></B></TD><TD>A table of defaults for Swing components.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="UIDefaults.LazyInputMap.html">UIDefaults.LazyInputMap</A></B></TD><TD><code>LazyInputMap</code> will create a <code>InputMap</code> in its <code>createValue</code> method.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="UIDefaults.ProxyLazyValue.html">UIDefaults.ProxyLazyValue</A></B></TD><TD>This class provides an implementation of <code>LazyValue</code> which can be used to delay loading of the Class for the instance to be created.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="UIManager.html">UIManager</A></B></TD><TD>This class keeps track of the current look and feel and its defaults.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="UIManager.LookAndFeelInfo.html">UIManager.LookAndFeelInfo</A></B></TD><TD>Provide a little information about an installed LookAndFeel for the sake of configuring a menu or for initial application set up.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="ViewportLayout.html">ViewportLayout</A></B></TD><TD>The default layout manager for <code>JViewport</code>.</TD></TR></TABLE> <P><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Exception Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="UnsupportedLookAndFeelException.html">UnsupportedLookAndFeelException</A></B></TD><TD>An exception that indicates the request look & feel management classes are not present on the user's system.</TD></TR></TABLE> <P><A NAME="package_description"><!-- --></A><H2>Package javax.swing Description</H2><P><P>Provides a set of "lightweight"(all-Java language) components that,to the maximum degree possible, work the same on all platforms.For a programmer's guide to using these components, see<a href="http://java.sun.com/docs/books/tutorial/uiswing/index.html">Creatinga GUI with JFC/Swing</a>, a trail in <em>The Java Tutorial</em>.For other resources, see <a href="#related">Related Documentation</a>.<p>The Swing architecture provides a number of advantages in theareas of:<UL> <LI><A HREF="#components">Wide Variety of Components</A> <LI><A HREF="#plaf">Pluggable Look and Feel</A> <LI><A HREF="#mvc">MVC Architecture</A> <LI><A HREF="#keys">Keystroke Handling</A> <LI><A HREF="#actions">Action Objects</A> <LI><A HREF="#containers">Nested Containers</A> <LI><A HREF="#desktops">Virtual Desktops</A> <LI><A HREF="#borders">Compound Borders</A> <LI><A HREF="#customDialogs">Customized Dialogs</A> <LI><A HREF="#stdDialogs">Standard Dialog Classes</A> <LI><A HREF="#structures">Structured Table and Tree Components</A> <LI><A HREF="#text">Powerful Text Manipulation</A> <LI><A HREF="#undo">Generic Undo Capabilities</A> <LI><A HREF="#accessibility">Accessibility Support</A></UL><H3><A NAME="components"></A>Wide Variety of Components</H3><P>In general, the class names that start with "J" are the components you add to an application.Examples: JButton, JLabel, JList, JPanel, JTable, JTree. The remaining files in the swing packagecontain the utility classes and interfaces that the components use to function.<H3><A NAME="plaf"></A>Pluggable Look and Feel</H3><P>Instead of being restricted to a single "look and feel", you can select a look and feel and "plugit in". An interface made of Swing components can look like a Win32 app, a Motif app, or a Mac app. It canuse the new "Metal" look and feel. Developers can use standard Swing components and design their ownlook and feel (L&F) for them, and even allow users to select the look and feel they prefer. The <CODE>plaf</CODE>package includes the standard "Pluggable Look And Feel" classes.<H3><A NAME="mvc"></A>MVC Architecture</H3><P>The Model-View-Controller (MVC) architecture is used consistently throughout the Swing component set.The View and Controller parts of the architecture are combined in the component. Each component has an associatedModel class and an interface it uses. You can provide your own data-model for acomponent by subclassing the Model class or by implementing the appropriate interface. For example,you could subclass <code>DefaultListModel</code> or implement the <code>ListModel</code> interface, and then usethe JList <code>setModel</code> method to attach your data-model to the component.<H3><A NAME="keys"></A>Keystroke Handling</H3><P>The JComponent architecture makes it easy to handle keyboard events in nested components. You register interestin a particular combination of keystrokes by creating a KeyStroke object and registering it with the component.When you register the keystroke combination and its associated action, you also specify one of the following conditionsto determine when the action is initiated:<UL> <LI>The component has the focus. <LI>A child or grandchild of the component has the focus.<BR> You can use this capability to define global actions for a composite component. For example, a tree control could act on the Plus key to expand all elements in the tree, as long as any component in the tree has the focus. <LI>The window the component is in has the focus.<BR> In other words, if the component is a child or grandchild of a window, and any component in that window has the focus, then the component receives the event. This capability is used to direct the keystroke combination Alt+C to the Cancel button in a dialog, for example, as long any component in the dialog has the focus.</UL><BLOCKQUOTE> For an index of the default keystroke behaviors for the Swing components in each of the standard Look and Feel implementations, see <a href="doc-files/Key-Index.html">Swing Component Keystroke Assignments</a>.</BLOCKQUOTE><H3><A NAME="actions"></A>Action Objects</H3><P>Action-interface objects provide a single point of control for program actions. For example, a toolbar iconand a menu item can reference the same Action object. When the Action object is disabled, the GUI items that referenceit are automatically disabled. The Action interface extends ActionListener, specifying an enabled property as wellas properties for text-descriptions and graphic icons.<H3><A NAME="containers"></A>Nested Containers</H3><P>As the keystroke handling shows, Swing was designed to manage nested containers gracefully.The main "heavyweight" containers (JWindow, JFrame, JDialog, and JApplet) as well as the major"lightweight" containers (JInternalFrame and JComponent) all delegate their operations to aJRootPane. This commonality produces a high degree of regularity in container nesting. In particular, sincethe fundamental component class (JComponent) contains a JRootPane, virtually <i>any</i> component can benested within another. It means, for example, that a graphic can be nested in a list, and a combo box canbe nested in a toolbar.The JRootPane class uses a JLayeredPane to manage a content pane and an optional menu bar in a way that isvirtually transparent to the developer. It also provides for a glass pane -- a single pane that can overlap multiplecontainers and be used for drawing or to intercept mouse actions.<H3><A NAME="desktops"></A>Virtual Desktops</H3><P>The JDesktopPane and JInternalFrame classes can be used to create a virtual desktop, or "multipledocument interface". A JInternalFrame can be specified as iconizable, exandable, or closable, while theJDesktopPane provides real estate for them to operate in.<H3><A NAME="borders"></A>Compound Borders</H3><P>Insets (the space between the edges of the component and the area it is drawn in) can be specified with a blankborder. In addition, many border styles are available, which can be combined to create compound borders.<H3><A NAME="customDialogs"></A>Customized Dialogs</H3><P>The JOptionPane class provides a variety of static methods that you can invoke to create and display both messagedialogs and user-choice dialogs in a variety of formats. The "message" displayed in the dialog can bea string, a string-generating object, or an arbitrary component. You can also replace the choice-buttons with componentsyou specify for user-selections.</P><P>For example, the following line creates a simple message dialog that requires the user's confirmation:<BLOCKQUOTE> <PRE>JOptionPane.showMessageDialog(null, "The file will be deleted.");</PRE></BLOCKQUOTE><P>Additional options for customized dialogs are described in the JOptionPane class.<H3><A NAME="stdDialogs"></A>Standard Dialog Classes</H3><P>Standard dialogs currently available include:<ul><li>JFileChooser<li>JColorChooser</ul>And more standard dialogs are on the way.<H3><A NAME="structures"></A>Structured Table and Tree Components</H3><P>The JTable class provides a data-aware matrix. JTree provides hierarchical-structuring ofdata elements.<H3><A NAME="text"></A>Powerful Text Manipulations</H3><P>In addition to single-font text fields and text areas, Swing provides a JPassword field for hiddeninput and a JTextPane class for displaying multi-font text. In addition, the JEditorPane class providesediting capabilities for multi-font text, while the text.html and text.rtf packages handle text encodedin HyperText Markup Language (HTML) or Rich Text Format (RTF).<H3><A NAME="undo"></A>Generic Undo Capabilities</H3><P>The undo package provides generic undo capabilities that can be used in a variety of situations.<H3><A NAME="accessibility"></A>Accessibility Support</H3><P>Swing has built-in support for developers to make products that are compatible with Assistive Technologies (foralternative interfaces like, for example, braille.) All of the Swing components implement interface Accessible.<!--<H2>Package Specification</H2><UL> Link to updated API specification to be added here.</UL>--><H2><a name="related">Related Documentation</a></H2><P>For overviews, tutorials, examples, guides, and other documentation, please see:<UL> <LI><A HREF="http://java.sun.com/products/jfc/tsc/">The Swing Connection</A> <LI><A HREF="http://java.sun.com/docs/books/tutorial/">The Java Tutorial</A> <LI><A HREF="http://developer.javasoft.com/developer/onlineTraining/">Online Training</A> at the Java Developer Connection<font size=-2><sup>SM</sup></font> <LI><A HREF="http://java.sun.com/products/jfc/">Java Foundation Classes (JFC)</A> home page</UL><P><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/sound/sampled/spi/package-summary.html"><B>PREV PACKAGE</B></A> <A HREF="../../javax/swing/border/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -