Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the Swing.table package?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you what the Swing.table package is, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The Swing package is a * * package provided by Swing, which contains nearly 100 classes and 25 interfaces. Almost all Swing components are in the Swing package, with the exception of JTableHeader and JTextComponent, which are in the Swing.Table package and the Swing.text package, respectively.

The Swing.border package contains several classes that border the edges of lightweight Swing components. The border package consists of a Border interface, an AbstractBorder class, and many concrete extensions to AbstractBorder.

Events and event listener classes are defined in the Swing.event package, and the Swing.event package is similar to AWT's event package. Both awt.event and Swing.event contain event classes and listener interfaces that respond to events fired by AWT components and Swing components, respectively. For example, when notification of node extension (or collapse) is required in a tree component, implement the TreeExpansionListener interface of Swing and pass an instance of TreeExpansionEvent to the method defined in the TreeExpansionListener interface. Both TreeExpansionListener and TreeExpansionEvent are defined in the Swing.event package.

The Swing.pending package includes Swing components that have not yet been fully implemented. In Swing1.1 FCS, the pending package contains selectors (date, currency selector) calculators, pop-up buttons, and so on. The components in the pending package will eventually be placed in the Swing package. Although the table component (JTable) of Swing is in the Swing package, its supporting classes are in the Swing.table package. The table model, cell painter, editor, and so on are all in the Swing.table package. Like the JTable class, Swing's tree class JTree (the structural component for organizing data hierarchically) is in the Swing package, while its supporting classes are in the Swing.tree package. The Swing.tree package provides supporting classes such as tree model, tree node, tree unit editor, and painter.

Swing has four packages for displaying and editing documents: Swing.text, Swing.text.html, Swing.text.html.parser, and Swing.text.rtf. The Swing.text package provides all the necessary lower-level artifacts for Swing's document model. Includes classes and interfaces for documents, elements, adding characters, highlighting, editing kits, and so on. The Swing.text.html and Swing.text.rtf packages are the smallest packages in Swing: they provide editor toolkits for implementing HTML (Hypertext markup language) and rtf (multiple text format) document editors, respectively.

The Swing.text.html.parser package contains supporting classes for parsing html files.

The Swing.undo package provides support for canceling operations.

The classes in the Swing.plaf package form the basis for the UI representative part of the Swing plug-in interface style. UI represents the implementation of interface patterns for their related components.

Most classes in the Swing.plaf package define UI resources or extend the Swing.ComponentUI class. The Swing.ComponentUI class defines the common behavior that all UI represents. The UI in the Swing.plaf package represents a class (that is, a class whose name ends in UI) and usually defines additional abstract methods for a particular component. For example, the Swing.plaf.ButtonUI class extends the Swing.ComponentUI class and adds the abstract method getDefaultMargin (), which returns the spacing between the button border and the button content.

The Swing.plaf.basic package extends the classes defined in the Swing.plaf package and implements features common to all standard Swing interface styles. For example, the Swing.plaf.basic.BasicButtonUI class provides default implementations of some methods defined by the Swing.ComponentUI class and the Swing.plaf.ButtonUI class. The BasicButtonUI class also provides several different implementations for methods such as paint (the paint method draws the button's text and icons). BasicButtonUI also implements other interface style-related methods in the form of no operations, such as the paintButtonPressed () method. These methods will be overloaded by specific interface style extensions. The metal and motif packages implement the UI representative class of the corresponding interface style. Typically, UI represents a class that extends a class in the Swing.plaf.basic package. For example, the metal.ButtonUI class overloads the no-action implementation of the paintButtonPressed method in the Swing.plaf.basic.ButtonUI class.

The Swing.plaf.multi package supports interface style reuse. Interface style reuse allows multiple UI representatives to be associated with a component. For example. A button UI representative may be associated with both a visual UI representative and an audio UI representative, so that when the button is activated, it is not difficult to generate visual feedback and play a sound. The main purpose of UI reuse is to make components more accessible.

Swing also provides two other interface style implementations, namely, mactintosh and Organic interface styles.

The above is all the content of the article "what is the Swing.table package?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report