Posts

Advance Java - Unit2.Introduction To Swing Technology

Image
  Swing Packages Should I Use? Most of the code uses only one or two Swing packages: javax.swing javax.swing.event  (not always required) 1.  More on Swing's  JComponent s The class hierarchy of Swing's top-level containers ( JFrame ,  JDialog ,  JApplet ) are as follows. These top-level Swing  containers are heavyweight, that rely on the underlying windowing subsystem of the native platform. The class hierarchy of Swing's  JComponent s is as follows.  JComponent  and its descendants are lightweight components. 1.1   ImageIcon Many Swing's  JComponent s (such as  JLabel  and  JButton ) support a text label and an image icon. For example, the figure shows three buttons: one with text label, one with an image icon, and one with both text and icon. The  javax.swing.ImageIcon  class models an image icon. An  ImageIcon  is a fixed-size picture, typically small, and mainly used for decorating GUI components. The  ImageIcon  class implements  javax.swing.Icon  interface, and h