08-01-2013, 10:57 AM
Java Swing
Java Swing.pdf (Size: 177.68 KB / Downloads: 36)
What is Java Swing?
•Swing is the primary Java GUI widget toolkit. It is part of Oracle's Java Foundation Classes (JFC) — an API for providing a graphical user interface(GUI) for Java programs.
•Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit (AWT).
What features are available?
• It has more powerful and flexible components than AWT.
•In add. to buttons, check box and labels, Swing provides several advanced components such as tabbed panel, scroll panes, trees, tables and lists.
•Unlike AWT components, Swing components are not implemented by platform-specific code. Instead they are written entirely in Java and therefore are platform-independent. The term "lightweight" is used to describe such an element.
•Java 2D API: images, figures, animation
• Pluggable look and feel: use samples or create your own
•Data Transfer: cut, copy, paste, drag & drop
•Internationalization: supports different input language, right to left reading
•Accessibility API: for people with disabilities
•Undo Framework API: supports unlimited numbers of actions to undo and redo
•Flexible Deployment: run within a browser as an applet or Java Web Start
Japplet Class
•Public class Japplet extends Applet implements Accessible, RootPaneContainer
•An extended version of java.applet.Applet that adds support for the JFC/Swing component architecture.
•JApplet is rich with functionality that is not found in applet such as it supports root pane ,glass plane, content panes.
Icons & Lables
•An icon is an object that adheres to the Icon interface. Swing provides a particularly useful implementation of the Icon interface: ImageIcon, which paints an icon from a GIF, JPEG, or PNG image.
•With the JLabel class, you can display unselectable text and images. If you need to create a component that displays a string, an image, or both, you can do so by using or extending JLabel. If the component is interactive and has a certain state, use a button instead of a label.