Advanced OOP MCS-3 OOP BSCS-3 Lecture # 6. TOPICS TO COVER GUI Components - > JframeGUI Components - > Jframe (javax.Swing.JFrame) JFrame() JFrame(String)

Slides:



Advertisements
Similar presentations
CMSC 341 Building Java GUIs. 09/26/2007 CMSC 341 GUI 2 Why Java GUI Development? Course is about Data Structures, not GUIs. We are giving you the opportunity.
Advertisements

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie July 20, 2005.
1 Chapter 13 Creating User Interfaces. 2 Objectives F To create graphical user interfaces with various user-interface components: JButton, JCheckBox,
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 16 Creating User Interfaces.
Swing Components III Chapter 12 - Student JFrame, Component Methods.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 15 Creating User.
IEEM 110 Computing in Industrial Applications Basic User Interface in Java.
1 UFCE3T-15-M Object- oriented Design and Programming Block 3 GUI Programming Jin Sa.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L03 (Chapter 15) Creating.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L04 (Chapter 15) Creating.
COMP 14 Introduction to Programming Miguel A. Otaduy June 7, 2004.
1 Creating User Interfaces. 2 Motivations A graphical user interface (GUI) makes a system user-friendly and easy to use. Creating a GUI requires creativity.
Unit 11 Object-oriented programming: Graphical user interface Jin Sa.
PROGRAMMING REVIEW Lab 2 EECS 448 Dr Fengjun Li and Meenakshi Mishra.
1 TCSS 143, Autumn 2004 Lecture Notes Graphical User Interfaces Koffman/Wolfgang Appendix C, pp
Object-Oriented Programming in Java. Object-Oriented Programming Objects are the basic building blocks in an O-O program. – A program consists of one.
1 Unit 9 : Graphical User Interface (GUI) 1. Explain the problem of creating a cross-platform GUI 2. Describe the Java way of creating GUIs 3. Use different.
TCU CoSc Introduction to Programming (with Java) Java Components.
Java the UML Way versjon Only to be used in connection with the book "Java the UML Way", by Else Lervik and.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 13 Creating User.
Creating User Interfaces F JComponent F JButton F JLabel F JTextField F JTextArea F JComboBox F JList F JCheckBox F JRadioButton F Dialogs.
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.
CS Lecture 01 Frames and Components and events Lynda Thomas
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 12 GUI Basics.
Chapter 9: Creating User Interfaces What is JavaBean? What is JavaBean? JComponent JComponent JButton JButton JLabel JLabel JTextField JTextField JTextArea.
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.
Chapter 9: Creating User Interfaces What is JavaBean? What is JavaBean? JComponent JComponent Jbutton Jbutton ImageIcon ImageIcon JLabel JLabel JTextField.
Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006 by Maria Litvin, Gary Litvin, and Skylight.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 9. GUI Components - > JFrame ->JComboBoxGUI Components - > JFrame ->JComboBox (javax.Swing.JComboBox) JComboBox()
Object Oriented Programming Engr. M. Fahad Khan Lecturer, Software Engineering Department University of Engineering & Technology, Taxila.
Java Graphics Graphical Components as objects. Graphics A Component is ◦A rectangular region of a computer screen ◦A graphical entity ◦Can sometimes contains.
Introduction to GUI Programming with Java Graphical User Interfaces With AWT and Swing Towson University *Ref:
Java Programming Applets. Topics Write an HTML document to host an applet Understand simple applets Use Labels with simple AWT applets Write a simple.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 15 Creating User.
Introduction to GUI in 1 Graphical User Interface 2 Nouf Almunyif.
May 12, 1998CS102-01Lecture 7-3 Building GUIs in Java I CS Lecture 7-3 A picture's worth a thousand words.
Graphical User Interfaces. Graphical input and output with JOptionPane.
Introduction to Java Chapter 9 - Graphical User Interfaces and Applets1 Chapter 9 Graphical User Interfaces and Applets.
Csc Basic Graphical User Interface (GUI) Components.
GUI Basics. Agenda What GUI How to make in java Creating frames Frequently used GUI components Layout Managers.
Visual Index of Swing GUI Components
Basics of GUI Programming Chapter 11 and Chapter 22.
Creating a Window. A basic window in Java is represented by an object of the class Window in the package java.awt.
Software Construction LAB 08 Java Programming with SWING GUI Builder.
Lecture 3.1 Using Graphics with JFrame. © 2006 Pearson Addison-Wesley. All rights reserved javax.swing.JFrame - int x - int y - int width - int.
Java Programming, Second Edition Chapter Thirteen Understanding Swing Components.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
Java GUI with Swing (Part I) Java – How to Program By Deitel & Deitel and iswing/index.html
Lecture 33: More Graphical User Interface (GUI) Announcements & Review Read Ch GU1 & GU2 Cohoon & Davidson Ch 14 Reges & Stepp Lab 10 set game due 4/26.
Lecture 08 Abstract Windows Toolkit (AWT) and Swing Jaeki Song.
Java Swing. Graphical User Interfaces (GUIs) GUI: An application that uses graphical objects to interact with users GUI applications consist of: – Events:
Dept. of CSIE, National University of Tainan 10/21/2012 Working with Swing.
Chapter 3: Widgets for a GUI General Component methods Useful widgets classes –Text classes Label TextField TextArea –Active widgets Button Checkbox Choice.
GUIs & Event-Driven Programming Chapter 11 Review.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 12 GUI Basics.
Java Visual Applications CSIS 3701: Advanced Object Oriented Programming.
Dale Roberts GUI Programming using Java - Windowing Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 7. GUI Components - > Jframe ->JPasswordField (javax.Swing.JPasswordField) GUI Components - > Jframe ->JPasswordField.
CompSci 230 S Programming Techniques
CSE 114 – Computer Science I Event Programming
Chapter 7 Creating User Interfaces
MSIS670: Object-Oriented Software Engineering
Chapter 13 Creating User Interfaces
Containers and Components
Components.
IFS410: Advanced Analysis and Design
Chapter 12 GUI Basics.
Ch. No Name Marks 01 AWT Networking JDBC Swing 05
Ch. No Name Marks 01 AWT Networking JDBC Swing 05
A picture's worth a thousand words
Presentation transcript:

Advanced OOP MCS-3 OOP BSCS-3 Lecture # 6

TOPICS TO COVER GUI Components - > JframeGUI Components - > Jframe (javax.Swing.JFrame) JFrame() JFrame(String) void super() void super(String) void setLayout() void setTitle(String) String getTitle() void setSize(int, int) void setLocation(int, int) void setBounds(int, int, int, int)

GUI Components - > JFrame add(component) void setJMenuBar(JMenuBar) void setDefaultCloseOperation(int) int getDefaultCloseOperation() DO_NOTHING_ON_CLOSE HIDE_ON_CLOSE //Default for JDialog and JFrame DISPOSE_ON_CLOSE default for JInternalFrame This removes the window from the screen and frees up any resources used by it. EXIT_ON_CLOSE (defined in the JFrame class) //Exit the application, using System.exit(0) TOPICS TO COVER

GUI Components - > Jframe -> JLabel (javax.Swing.Jlabel) JLabel(Icon) JLabel(Icon, int) int specifies horizontal alignment of label’s contents LEFT, CENTER, RIGHT, LEADING, TRAILING. JLabel(String) JLabel(String, Icon, int) JLabel(String, int) JLabel() void setText(String) String getText() void setIcon(Icon) Icon getIcon() setToolTipText(String) TOPICS TO COVER

GUI Components - > Jframe -> JLabel GUI Components - > Jframe -> JLabel void setVisible(boolean) void setVerticalTextPosition(int) int getVerticalTextPosition() void setHorizontalTextPosition(int) int getHorizontalTextPosition() Horizontal position constants LEFT CENTER RIGHT Vertical position constants TOP CENTER BOTTOM TOPICS TO COVER

GUI Components - > ImageIcon (javax.Swing.ImageIcon) ImageIcon(String)//file name GUI Components - > Jframe ->JTextField (javax.Swing.JTextField) JTextField() JTextField(String) JTextField(String, int) JTextField(int) //int is width in columns. String contains field's initial text. void setText(String) String getText() TOPICS TO COVER

GUI Components - > JFrame ->JTextField (javax.Swing.JTextField) void setEditable(boolean) boolean isEditable() void setColumns(int) int getColumns() void setHorizontalAlignment(int) int getHorizontalAlignment() void setVisible(boolean) void setFont(Font) void setForeGround(Color) TOPICS TO COVER

GUI Components - > Jframe ->JTextArea Javax.Swing.JTextArea JTextArea() JTextArea(int, int)//rows and columns JTextArea(String) JTextArea(String, int, int) void append(String) int getColumns() int getRows() int insert(String, int)//position void replaceRange(String, int, int)//starting and ending index void setColumns(int) voidsetFont(Font) voidsetLineWrap(boolean) voidsetRows(int)//number of rows TOPICS TO COVER

GOOD LUCK ! ☻...