Lecture 19
Upcoming SlideShare
Loading in...5

Lecture 19



Notes on core java

Notes on core java



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Lecture 19 Lecture 19 Document Transcript

  • Core Java Debasish Pratihari Swing  Swing provides rich set of Components for building GUI.  Swing provides a feature called pluggable look-and-feel that makes possible to change the appearance of a component.  Swing is a part of Java Foundation Classes(JFC).  Swing gives Undo support.  Unlike AWT components, swing components are not implemented by platform-specific code. Instead, they are written entirely in java and therefore, are platform independent. This types of components are termed as light weight components.  For Swing Components, you have to import javax.swing package. Highlights of Swing Components :      Pluggable look-and –feel Similar looks in cross-platform ToolTip test Decorative Borders Icons for many Components Lecture/core/swing/19 Page #1 feel the Technology…
  • Core Java Debasish Pratihari Visual Introduction of Swing Components Components Class Name Events JLabel JButton ActionEvent JToggleButton ActionEvent ItemEvent JCheckBox ItemEvent ActionEvent JRadioButton ActionEvent ItemEvent JComboBox ItemEvent JList ListSelectionEvent JTextField JTextArea Lecture/core/swing/19 KeyEvent FocusEvent KeyEvent FocusEvent Page #2 feel the Technology…
  • Core Java Components Class Name Debasish Pratihari Events JScrollBar AdjustmentEvent JSlider ChangeEvent JPasswordField KeyEvent FocusEvent JTable TableModelEvent JTree FocusEvent JColorChooser Lecture/core/swing/19 Page #3 feel the Technology…
  • Core Java Debasish Pratihari JDialog JFileChooser JTabbedPane Lecture/core/swing/19 Page #4 feel the Technology…
  • Core Java Debasish Pratihari Top Level- Containers:  Swing provides three useful top-level container classes as follows  JFrame  JDialog  JApplet  You can optionally add a menu bar to a toplevel container. The menu bar is by convention positioned within the top-level container, but outside the content pane.  To be displayed on a screen, every GUI Component must be part of a Containment hierarchy.  A Containment hierarchy is a tree of Components that has a top-level Container as its root.  As a rule, a standalone application with a Swingbased GUI has at least one containment hierarchy with a JFrame as its root.  A Swing-based applet has at least one containment hierarchy, exactly one of which is rooted by a JApplet object. Window Panes : Note : The area of the window below the title bar is a JRootPane Object Optional menubar layeredPane object of type JLayeredPane contentPane object of type JInternalPane Lecture/core/swing/19 Page #5 The contentPane is where components are added except Menubar. A reference to contentPane is returned when you call the getContentPane( ) method for the JFrame object. feel the Technology…