Field Trip #29 Creating an Event Calendar with Java By Keith Lynn.

Slides:



Advertisements
Similar presentations
Macromedia Director 8 Foundation Level Course. What is Director? Director is a challenging program for creating animation and multimedia productions for.
Advertisements

Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Lecture 15 Graphical User Interfaces (GUI’s). Objectives Provide a general set of concepts for GUI’s Layout manager GUI components GUI Design Guidelines.
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Unit 11 Object-oriented programming: Graphical user interface Jin Sa.
Advanced Java Class GUI, part 2. JComponent methods addXXXListener(XXXListener) repaint() – [optional arguments: delay and coordinates of sub-area to.
1 Class 8. 2 Chapter Objectives Use Swing components to build the GUI for a Swing program Implement an ActionListener to handle events Add interface components.
Chapter 6: Graphical User Interface (GUI) and Object-Oriented Design (OOD) J ava P rogramming: Program Design Including Data Structures Program Design.
A.k.a. GUI’s.  If you want to discuss your Lab 2 grade come see me this week. ◦ Office: 436 ERB. One hour prior to class ◦ Open to Appointments MWF 
Java Programming Chapter 10 Graphical User Interfaces.
Chapter 13 Advanced GUIs and Graphics. Chapter Objectives Learn about applets Explore the class Graphics Learn about the class Font Explore the class.
JLabel, JTextField, JButton and JOptionPane
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Field Trip #26 Create a Find a Word Puzzle in Java By Keith Lynn.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 12 Advanced GUIs and Graphics.
Java Programming: From Problem Analysis to Program Design, Second Edition1  Learn about basic GUI components.  Explore how the GUI components JFrame,
Field Trip # 21 Creating PDFs with Java By Keith Lynn.
Objectives of This Session
Ch 3-4: GUI Basics Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: GUI Components.
Field Trip #19 Animations with Java By Keith Lynn.
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
Field Trip #31 CrossWord Puzzle By Keith Lynn. JApplet A JApplet is a top-level container in Java We will use the JApplet to contain two Jpanels The first.
Field Trip #32 Digital Alarm Clock By Keith Lynn.
MSc Workshop - © S. Kamin, U. ReddyLect 3 - GUI -1 Lecture 3 - Graphical User Interfaces r GUI toolkits in Java API r JFrame r GUI components.
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.
Chapter 2 – Introduction to the Visual Studio .NET IDE
ITEC 109 Lecture 27 GUI Interaction. Review GUI basics JFrame JPanel JLabel, JButton, JTextField Layout managers –Flow / Box –Border / Grid.
ITEC 109 Lecture 27 GUI. GUIs Review Sounds –Arrays hold sample values –Creating a keyboard –Sound effects Homework 3 –The big two –Due after break –Lab.
University of Limerick1 Software Architecture Java Layout Managers.
Field Trip #28 Securing a VNC Connection with Java By Keith Lynn.
Field Trip #22 Creating an Excel Spreadsheet with Java By Keith Lynn.
GUI Applications ButtonGroup and JRadioButton. Contents A.Problem: The Metric Converter Application B.Solution C.Exercise: Moving all calculations into.
Field Trip #25 Creating a Client/Server By Keith Lynn.
Field Trip #23 Hangman By Keith Lynn. JApplet A JApplet is a top-level container An applet is a small Java program that is executed by another program.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Java Programming: From Problem Analysis to Program Design, Second Edition1 Lecture 5 Objectives  Learn about basic GUI components.  Explore how the GUI.
Lecy ∙ Data-Driven Management Lecture 12 Building Shiny Apps.
Field Trip #27 Using Java to Download Images and Sounds By Keith Lynn.
Creating a Window. A basic window in Java is represented by an object of the class Window in the package java.awt.
Ajmer Singh PGT(IP) JAVA IDE Programming - I. Ajmer Singh PGT(IP) GUI (Graphical User Interface) It is an interface that uses a graphic entities along.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Swing GUI Components So far, we have written GUI applications which can ‘ draw ’. These applications are simple, yet typical of all Java GUI applications.
Field Trip #34 Creating and Reading Zip Files in Java By Keith Lynn.
Introduction to GUI Programming in Java: Frames, Simple Components, and Layouts.
BeeSpoke User Delivery Ryan Bibby. System Functions  Main Menu  New Resource  Loan Resource  Return Resource  Reminders Report  Usage Report  New.
Section 10.1 Define scripting
Chapter 9: Graphical User Interfaces
A First Look at GUI Applications
Chapter 2 – Introduction to the Visual Studio .NET IDE
Processing Timer Events
Graphical User Interface (pronounced "gooey")
Graphical User Interface (GUI) Programming III
Creation of an Android App By Keith Lynn
Java Programming: From Problem Analysis to Program Design,
Ellen Walker Hiram College
Chap 7. Building Java Graphical User Interfaces
Chapter 13: Advanced GUIs and Graphics
Graphical User Interfaces -- Introduction
Timer class and inner classes
Basic Elements of The GUI
UNIT-5.
Week 8 Swing NetBeans GUI Builder
CiS 260: App Dev I Chapter 6: GUI and OOD.
Let us Flex our Gooey Guis, Sire
Advanced GUIs and Graphics
Graphical User Interface
TA: Nouf Al-Harbi NoufNaief.net :::
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

Field Trip #29 Creating an Event Calendar with Java By Keith Lynn

JFrame A JFrame is a top-level container It can run in a stand alone program It can contain independent panels The JFrame has a title

JButton A JButton is a component that we can place on a JFrame It is a push button We can place a label in the button A JButton has a margin. If the label won't display, we can obtain the insets of the button and change the margin

JTextComponent In order to get input from the user, we will use a JtextField A JtextField is a JtextComponent It is a box on the screen We can retrieve the text in a box with the method getText()

iText We will use a third party library called iText iText was written by Bruno Lowagie It allows us to directly create PDF documents We begin with creating a Document object and then a PdfWriter The PdfWriter is created using the Document and a FileOutputStream attached to a file After we have completed the document, we need to save it

PdfContentByte There are many things we can place in a PDF document One way of adding content is to draw directly on it In order to do this, we obtain the PdfContentByte of the document We use the method getDirectContent on the PdfWriter

Finding Days of Month We make use of the Calendar class The Calendar class is found in the java.util package When we create a Calendar object, we will set the year, month, and day of the month the user specified Then using the field DAY_OF_WEEK, we can determine where the current day falls We can then fill in the numbers of the month

Drawing a Grid In order to draw the grid on the screen, we will use the PdfContentByte To create a line on the screen, we move to a certain location with the moveTo method Then we move to another location with the lineTo method After we have moved to all the locations, we call the method stroke Repeating this, we can draw a rectangle

Displaying Event We will make use of arrays in this app An array is a collection of elements of the same type The array we will create will contain objects that contain information about the current day of the week In particular, we will include whatever event the user entered

Displaying the Month After we have created the object representing the days of the week and the events, we use the method setTextMatrix to hold text We can change the font We can change the color We can change the font using a BaseFont We can change the color using a BaseColor After the events are displayed, we can save the document

The Calendar