Content deleted Content added
No edit summary |
m Fix broken anchor: #Java SE 6 Update 10→most alike anchor Java version history#Java SE 6, #Java SE 6 Update 10→most alike anchor Java version history#Java SE 6 |
||
Line 63:
For example, the {{Javadoc:SE|javax/swing|JTable}} has a model called {{Javadoc:SE|javax/swing/table|TableModel}} that describes an interface for how a table would access tabular data. A default implementation of this operates on a two-dimensional [[Array data structure|array]].
The view component of a Swing JComponent is the object used to graphically represent the conceptual GUI control. A distinction of Swing, as a GUI framework, is in its reliance on programmatically rendered GUI controls (as opposed to the use of the native host OS's GUI controls). Prior to [[Java version history#Java SE 6
Finally, in terms of visual composition and management, Swing favors [[Layout manager|relative layouts]] (which specify the positional relationships between components) as opposed to absolute layouts (which specify the exact ___location and size of components). This bias towards "fluid"' visual ordering is due to its origins in the [[Java applet|applet]] operating environment that framed the design and development of the original Java GUI toolkit. (Conceptually, this view of the layout management is quite similar to that which informs the rendering of HTML content in browsers, and addresses the same set of concerns that motivated the former.)
Line 73:
By contrast, Swing components are often described as ''lightweight'' because they do not require allocation of native resources in the operating system's windowing toolkit. The AWT components are referred to as ''heavyweight components''.<ref>{{cite web |last1=Zakhour |first1=Sharon |last2=Petrov |first2=Anthony |date=April 2010 |df=mdy |url=https://www.oracle.com/technical-resources/articles/java/mixing-components.html |title=Mixing Heavyweight and Lightweight Components |publisher=[[Oracle Corporation|Oracle]] |access-date=2020-07-26}}</ref>
Much of the Swing API is generally a complementary extension of the AWT rather than a direct replacement. In fact, every Swing lightweight interface ultimately exists within an AWT heavyweight component because all of the top-level components in Swing ({{Javadoc:SE|javax/swing|JApplet}}, {{Javadoc:SE|javax/swing|JDialog}}, {{Javadoc:SE|javax/swing|JFrame}}, and {{Javadoc:SE|javax/swing|JWindow}}) extend an AWT top-level container. Prior to [[Java version history#Java SE 6
The core rendering functionality used by Swing to draw its lightweight components is provided by [[Java 2D]], another part of JFC.
|