Ch. No Name Marks 01 AWT Networking JDBC Swing 05

Slides:



Advertisements
Similar presentations
FH-Hof Dialoge Richard Göbel. FH-Hof Inhalt JDialog Vordefinierte Dialoge File Browser.
Advertisements

Introduction to Swing Components Chapter 14. Part of the Java Foundation Classes (JFC) Provides a rich set of GUI components Used to create a Java program.
Swing! Components and Images. Example Swing Components (also called “widgets”) Graphic from sun.com.
User Interface Design CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
 Command line  Input: Scanner class  Output: System.out.println()  GUI Components  Input: Text Fields, Mouse Clicks  Output: Labels, Dialog Boxes.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie July 20, 2005.
 What are the basic GUI components we’ve learned so far? › JFrame › JPanel › JButton › JLabel › JTextArea › JTextField › JCheckBox › JRadioButton › Paint.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Graphical User Interfaces (GUIs) GUI: An application that uses graphical objects to interact with users GUI applications consist of: –Events: A user or.
Swing Components III Chapter 12 - Student JFrame, Component Methods.
THE SWING UI TOOLKIT Mostly from “The Swing Connection”The Swing Connection.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L03 (Chapter 15) Creating.
1 GUI Elements in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
COMP 14 Introduction to Programming Miguel A. Otaduy June 7, 2004.
Scott Grissom, copyright 2006Ch 11: GUI Slide 1 Graphical User Interfaces (Ch 11) Careful design of a graphical user interface is key to a viable software.
F27SB2 Software Development 2 Lecture 9: Java GUIs 6.
SWING. Split Panes JSplitPane is used to divide two (and only two) Components. The two Components are graphically divided based on the look and feel implementation,
Applets and Frames CS 21a: Introduction to Computing I First Semester,
Introduction to GUI in Java 1. Graphical User Interface Java is equipped with many powerful,easy to use GUI component such as input and output dialog.
Object Oriented Programming Ders 11: Interfaces Mustafa Emre İlal
Java Programming, Second Edition Chapter Five Input and Selection.
Introduction to Swing Components Chapter 14.  Part of the Java Foundation Classes (JFC)  Provides a rich set of GUI components  Used to create a Java.
Java How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Java Swing. Swing is a set of classes that provides more powerful and flexible components than are possible with the AWT. In addition to the familiar.
GUI Clients 1 Enterprise Applications CE00465-M Clients with Graphical User Interfaces.
Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006 by Maria Litvin, Gary Litvin, and Skylight.
Java Programming: Advanced Topics 1 Components and Facilities for Rich Graphical User Interfaces Chapter 7.
Timer class and inner classes. Processing timer events Timer is part of javax.swing helps manage activity over time Use it to set up a timer to generate.
Object Oriented programming Instructor: Dr. Essam H. Houssein.
CSCI Swing1 The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness –The Abstract.
Java Programming Applets. Topics Write an HTML document to host an applet Understand simple applets Use Labels with simple AWT applets Write a simple.
Programming with Java’s Swing API February 4, 2003 CMPS Advanced Programming Graphical User Interfaces.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 15 Creating User.
Swing / Session1 / 1 of 30 Module Introduction Distributed Computing in Java.
GUI Graphical User Interface Each onscreen component and window is an object Object interaction makes communication and scoping challenging Event-driven.
Swing. Introduction to Swing What is Swing? “ Swing is a diverse collection of lightweight components that can be used to build sophisticated user interfaces.”
5-Jan-16 R Ramesh Swing. 5-Jan-16 R Ramesh An Introduction to Java Foundation Classes (JFC) A suite of libraries to assist programmers create enterprise.
The Swing GUI Components Chapter 29 An enhanced alternative to AWT The PC does not need an appletviewer or browser Swing overcomes some AWT drawbacks.
Basics of GUI Programming Chapter 11 and Chapter 22.
Java GUI COMP 401 Fall 2014 Lecture 16 10/20/2014.
Java Programming, Second Edition Chapter Thirteen Understanding Swing Components.
Chapter 14: Introduction to Swing Components. Objectives Understand Swing components Use the JFrame class Use the JLabel class Use a layout manager Extend.
JOptionPane Class JOptionPane makes it easy to pop up a standard dialog box that prompts users for a value or informs them of something. While the JOptionPane.
SE-1020 Dr. Mark L. Hornick 1 Graphical User Interfaces.
Creating and Using Dialogs ● A dialog is a box that pops up and prompts the user for a value or informs them of something ● One way: directly create objects.
1 IM103 week 10 Enhancing the user interface By the end of lecture you should be able to:  distinguish between heavyweight and lightweight components;
Designing a User Interface with Swing Assignment Swing: Update code of an earlier program.
제 14 장 고급 스윙 컴포넌트.
Introduction to GUI in 1 Graphical User Interface Nouf Almunyif.
Java Programming Fifth Edition Chapter 13 Introduction to Swing Components.
GUIs & Event-Driven Programming Chapter 11 Review.
Dale Roberts GUI Programming using Java - Windowing Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Prepared by: Dr. Abdallah Mohamed, AOU-KW Unit 6 Graphical user interfaces 1.
Module 13: Swing API Object Oriented Programming(Java)
Java Swing What is swing? Swing is a ”Lightweight” GUI ToolKit for Java Different from AWT / SWT Toolkits for GUIs Few lines of code to produce GUI elements.
A Quick Java Swing Tutorial
Building a Swing Interface
Advanced GUI Programming
Graphical User Interface (pronounced "gooey")
JAVA SWINGS By: Pavan D.M..
Graphical User Interface (GUI) Components: Part 1 Java How to Program, 9 th Edition Chapter 14.
CSE 114 – Computer Science I Event Programming
JOptionPane Dialogs javax.swing.JOptionPane is a class for creating dialog boxes. Has both static methods and instance methods for dialogs. Easy to create.
Timer class and inner classes
Introduction to GUI in Graphical User Interface Nouf Almunyif.
IFS410: Advanced Analysis and Design
CS431 ws99 Half Text Half Graphics
Ch. No Name Marks 01 AWT Networking JDBC Swing 05
Graphical User Interface
Chapter 4 Interface Types and Polymorphism Part 1
Presentation transcript:

Ch. No Name Marks 01 AWT 24 02 Networking 18 03 JDBC 20 04 Swing 05 Advance Java Programming Ch. No Name Marks 01 AWT 24 02 Networking 18 03 JDBC 20 04 Swing 05 Servlet

Tour of Swing Contains Classes and Methods. javax.swing.*

Content Features JApplet ImageIcon JLabel JButton JCombobox JTextField JTabbedPane JScrollPane JTable JTree

Features Lightweight Component Border to component using setBorder() setToolTipText() method Look and Feel Scrolling to component Layout Manager: Box and Overlay Additional Component

JApplet Present in javax.swing package getContentPane() method Component added in Container

ImageIcon ImageIcon (String Filename) ImageIcon (URL u) getIconHeight() getIconWidth()

JLabel JLabel () JLabel (String Text) JLabel (Icon i) JLabel (String text, Icon I,int Alignment) JLabel (Icon I, int alignment) JLabel (String text, int alignment) Constant: Center-0 Left- 2 Right-4 Top- 1 Bottom- 3 Leading-10 Trailing-11

Methods setIcon (icon i) setText (String text) getText() getIcon() setHorizontalTextPosition (int position) setVerticalTextPosition (int position) setHorizontalAlignment (int alignment) setVerticalAlignment (int alignment) setIconTextGap ()

JButton JButton () JButton (String Text) JButton (Icon i) JButton (String text, Icon I) Methods of JLabel Applicable for JButton

JTextField JTextField () JTextField (int noofcoloumn) JTextField (String str) JTextField (String str, int no ofcoloumn)

JCombobox JComboBox() JcomboBox(Object o[]) All methods of Choice applicable

JScrollPane JScrollPane() JScrollPane(Component p) JScrollPane (Component p, int vsb, int hsb) ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED (20) ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED (30) ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS (22) ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS (32)

JTable JTable() JTable(int rows, int columns) JTable(Object Data[][], Object Column[]) Steps: Create JTable Create Jscrollpane Add JTable to JScrollpane Add Jscrollpane to container

JTree JTree (Object o) JTree (Root Node a) DefaultMutableTreeNode Steps: Create JTree Create Jscrollpane Add JTree to JScrollpane Add Jscrollpane to container

JTabbedPane JTabbedPane() JTabbedPane(int tabPlacement) JTabbedPane(int tabPlacement, int tabLayoutPolicy) JTabbedPane.TOP 1 JTabbedPane.BOTTOM 3 JTabbedPane.LEFT 2 JTabbedPane.RIGHT 4 JTabbedPane.WRAP_TAB_LAYOUT 0 JTabbedPane.SCROLL_TAB_LAYOUT 1

Methods addTab (String Title, Icon I, Component c) addTab (String Title,Component i) getSelectedIndex() setSelectedIndex (int index) getTabCount () removeTabAt (int index) getTitleAt (int index) setTileAt (int index, String title) setBackgroundAt ( int index, Color c) setForegroundAt (int index, Color c) Listener: ChangeListener method: stateChanged() Event:ChangeEvent

JOptionPane It used to display dialog box for better GUI It has 4 dialog MessageDialog InputDialog ConfirmDialog OptionDialog

JOptionPane Message type constant ErrorMessage- 0 InformationMessage- 1 WarningMessage- 2 QuestionMessage- 3 PlainMessage- -1

JOptionPane Option Type constant Default- -1 YES_NO- 0 YES_NO_CANCEL- 1 OK_CANCEL- 2

JOptionPane Output Type constant YES- 0 No- 1 CANCEL- 2 OK- 0 CLOSED- -1

showMessageDialog sMD(Parent, String message) sMD(Parent,Message,Title,Mtype) SMD(Parent,Message,Title,Mtype,icon)

showInputDialog sID(Parent, String message) sID(Parent,Message,Title,Mtype) sID(Parent,Message,initialvalue) sID( parent,  message,  title,  messageType,  icon, Object[] selectionValues, Object initialSelectionValue )

showConfirmDialog sCD(Parent, String message) sCD(Parent,Message,Title,Otype) sCD(Parent,Message,Title,Otype,Mtype) sCD(Parent,Message,Title,Otype,Mtype,icon)

showOptionDialog sOD(Parent,Message,Title,Otype,Mtype,icon, Object o[], Object initialvalue)

JColorChooser

JSlider

JProgressBar