cs Java: lecture #5

Size: px
Start display at page:

Download "cs Java: lecture #5"

Transcription

1 cs Java: lecture #5 news: homework #4 due today homework #5 out today today s topics: applets, networks, html graphics, drawing, handling images graphical user interfaces (GUIs) event handling interfaces cs java-spring2003-sklar-lect05 1

2 networks (1). two or more computers connected to each other networked computers can share information and resources, e.g.: printer file server example: CUNIX system connections: point-to-point computers are directly connected to each other message speed is fast adding computers is expensive single communication line message speed can be slow adding computers is cheap cs java-spring2003-sklar-lect05 2

3 networks (2). network address uniquely identifies each computer on the network packet long messages are split into pieces each piece is a packet, sent individually along the network improves message speed local-area network (LAN) designed to span short distances wide-area network (WAN) designed to span longer distances connects multiple LANs cs java-spring2003-sklar-lect05 3

4 networks (3). the Internet developed in the 1970s as ARPANET the ultimate WAN a network of networks protocol set of rules governing communication TCP/IP (transmission control protocol / internet protocol) IP address = network address on the Internet numeric, e.g., also have text equivalents called Internet addresses, which are comprised of local computer names (i.e., name of computer on LAN) plus domain names (i.e., name of LAN on WAN) domain names are controlled by the Internet Naming Authority domain name system (DNS) translates between IP address and Internet address cs java-spring2003-sklar-lect05 4

5 networks (4). the World Wide Web (WWW) provides standard method of interfacing to the Internet from the user level uses hypertext non-linear method of organizing information refers only to textual information hypermedia refers to non-textual information, such as sound, video and graphics browser user program that provides method of viewing WWW documents early browsers included: Archie, Gopher Mosiac first graphical WWW browser released in 1993 became Netscape cs java-spring2003-sklar-lect05 5

6 networks (5). HyperText Markup Language (HTML) standard format for WWW documents Uniform Resource Locator (URL) unique document address on the WWW HypterText Transfer Protocol (http) protocol used for transfering HTML documents provides one-way transfer from server to client other protocols include: ftp, telnet these provide two-way transfer between server and client Java grew out of the above allows two-way transfer text, graphics, sound cs java-spring2003-sklar-lect05 6

7 networks (6). client-server architecture comes from operating system design methodology by which tasks are divided onto different processors according to functionality programs can be divided into: computation portion drawing or output portion each portion can be executed on a different CPU X windows windowing system used under UNIX with X windows, the drawing is done on the client, although the execution may be happening on a different physical machine, the server cs java-spring2003-sklar-lect05 7

8 applets (1). Java programs can run as applications or applets application: executed using the java command server and client can be the same machine or different machines client invokes JVM which interprets classes and runs them applet: must be executed using a browser, like Netscape, or the appletviewer command server sends applet to the client, in the form of class files; applet invokes JVM which interprets classes and runs them on the client there are two parts: an HTML file used to invoke the applet Java class file(s) that contain the applet code cs java-spring2003-sklar-lect05 8

9 applets (2). file name = hi.html <html> <title> sample applet page </title> the applet will be shown below... <applet code="hi.class" width=400 height=400> </applet> </html> cs java-spring2003-sklar-lect05 9

10 applets (3). file name = hi.java import java.awt.*; import java.applet.applet; public class hi extends Applet { public void paint( Graphics g ) { g.drawstring( "hi",10,10 ); } // end of paint() } // end of class hi cs java-spring2003-sklar-lect05 10

11 applets (4). java.awt package Abstract Windowing Toolkit (AWT) classes that support graphical user interfaces (GUI) includes java.awt.component method: public void paint() java.applet.applet class public void init() public void start() public void stop() cs java-spring2003-sklar-lect05 11

12 frames (1). used when you want to write an application that has graphics relationship between Frame and Applet: java.lang.object +--java.awt.component +--java.awt.container +--java.awt.panel +--java.applet.applet java.lang.object +--java.awt.component +--java.awt.container +--java.awt.window +--java.awt.frame cs java-spring2003-sklar-lect05 12

13 frames (2). import java.awt.*; public class hiho extends Frame { mycanvas c; public hiho( String title ) { super( title ); } // end of hiho constructor public static void main( String[] args ) { hiho h = new hiho( "myframe!" ); h.c = new mycanvas(); h.add( h.c ); h.setsize( 100,100 ); h.setbackground( Color.red ); h.show(); } // end of main() } // end of class hiho cs java-spring2003-sklar-lect05 13

14 frames (3). import java.awt.*; public class mycanvas extends Canvas { public Dimension getminimumsize() { return( new Dimension( 90,90 )); } // end of getminimumsize() public void paint( Graphics g ) { setbackground( Color.blue ); g.drawstring( "hiho",10,10 ); } // end of paint() } // end of class mycanvas cs java-spring2003-sklar-lect05 14

15 graphics (1). java.awt.graphics class X-windows coordinate system drawing primitives: lines Strings rectangles ovals arcs color cs java-spring2003-sklar-lect05 15

16 graphics (2). simple methods from the java.awt.graphics class void drawline( int x1, int y1, int x2, int y2 ); draws a line connecting (x1,y1) and (x2,y2 ); void drawstring( String str, int x, int y ); draws the text in str, with its lower left corner at (x,y) cs java-spring2003-sklar-lect05 16

17 graphics (3). import java.awt.*; import java.applet.applet; public class hi2 extends Applet { public void paint ( Graphics g ) { g.drawstring( "hello world!",10,10 ); g.drawline( 0,400, 400,0 ); } // end of paint() } // end of class hi2() cs java-spring2003-sklar-lect05 17

18 graphics (4). bounding rectangles coordinates of origin (upper left corner) extent (width and height) arcs measured in degrees starting from 0 (along positive X-axis) extent (total angle of arc) cs java-spring2003-sklar-lect05 18

19 graphics (5). methods from the java.awt.graphics class for drawing outlines of shapes void drawrect( int x, int y, int width, int height ); draws a rectangle with its upper left corner at (x,y), extending the specified width and height void drawoval( int x, int y, int width, int height ); draws an oval circumscribed in the bounding rectangle with its upper left corner at (x,y), extending the specified width and height void drawarc( int x, int y, int width, int height, int startangle, int arcangle ); draws an arc whose oval is circumscribed in the bounding rectangle with its upper left corner at (x,y), extending the specified width and height, where the arc starts at the startangle, measured in degrees (where 0 ) is horizontal along the positive x-axis), extending for arcangle degrees cs java-spring2003-sklar-lect05 19

20 graphics (6). import java.awt.*; import java.applet.applet; public class hi3 extends Applet { public void paint ( Graphics g ) { g.drawrect( 10,300,25,25 ); g.drawoval( 10,250,25,25 ); g.drawarc( 10,200,25,25,45,90 ); } // end of paint() } // end of class hi3() cs java-spring2003-sklar-lect05 20

21 graphics (7). methods from the java.awt.graphics class for drawing filled shapes void fillrect( int x, int y, int width, int height ); draws a filled rectangle with its upper left corner at (x,y), extending the specified width and height void filloval( int x, int y, int width, int height ); draws a filled oval circumscribed in the bounding rectangle with its upper left corner at (x,y), extending the specified width and height void fillarc( int x, int y, int width, int height, int startangle, int arcangle ); draws a filled arc whose oval is circumscribed in the bounding rectangle with its upper left corner at (x,y), extending the specified width and height, where the arc starts at the startangle, measured in degrees (where 0 ) is horizontal along the positive x-axis), extending for arcangle degrees cs java-spring2003-sklar-lect05 21

22 graphics (8). methods from the java.awt.graphics class for drawing polygons void drawpolygon(int[] xpoints, int[] ypoints, int npoints); draws a closed polygon defined by arrays of x and y coordinates void drawpolygon( Polygon p ); draws the outline of a polygon defined by the specified Polygon object void drawpolyline( int[] xpoints, int[] ypoints, int npoints ); draws a sequence of connected lines defined by arrays of x and y coordinates the first two have counterparts for drawing filled polygons: void fillpolygon(int[] xpoints, int[] ypoints, int npoints); void fillpolygon( Polygon p ); cs java-spring2003-sklar-lect05 22

23 graphics (9). java.awt.color class color is defined using the RGB methodology Red, Green, Blue each is an integer between 0 and 255, where 0 means no color and 255 means maximum color so white is: red=255 green=255 blue=255 or the ordered triple (255,255,255) and black is: red=0 green=0 blue=0 and red is: red=255 green=0 blue=0 and green is: red=0 green=255 blue=0 and blue is: red=0 green=0 blue=255 make up your own colors... cs java-spring2003-sklar-lect05 23

24 graphics (10). even more methods from the java.awt.graphics class void setcolor( Color color ); sets the foreground (pen) color to the specified color void fillrect( int x, int y, int width, int height ); draws a filled rectangle with its upper left corner at (x,y), extending the specified width and height void filloval( int x, int y, int width, int height ); draws a filled oval circumscribed in the bounding rectangle with its upper left corner at (x,y), extending the specified width and height void fillarc( int x, int y, int width, int height, int startangle, int arcangle ); draws a filled arc whose oval is circumscribed in the bounding rectangle with its upper left corner at (x,y), extending the specified width and height, where the arc starts at the startangle, measured in degrees (where 0 ) is horizontal along the positive x-axis), extending for arcangle degrees cs java-spring2003-sklar-lect05 24

25 graphics examples. snowman.java bullseye.java snowman2.java, man.java (with helper class) snowman3.java (animated) snowman4.java (another way of doing animation) cs java-spring2003-sklar-lect05 25

26 GUIs (1). GUI = Graphical User Interface java.awt classes: Component Container LayoutManager Event java.awt.event classes: ActionListener ItemListener KeyListener MouseListener MouseMotionListener cs java-spring2003-sklar-lect05 26

27 GUIs (2). components a component is a building block of any GUI here are some examples: Label TextField, TextArea Button Checkbox, CheckboxGroup Choice List cs java-spring2003-sklar-lect05 27

28 GUIs (3). containers a container is a special component that can hold other components here are some examples: Applet Frame Panel cs java-spring2003-sklar-lect05 28

29 GUIs (4). layout managers a layout manager describes where the components are laid out within a given container you need to set the layout manager for each container you can nest containers (and their layour managers) BorderLayout simplest layout manager looks like this: north west center east south GridBagLayout more complex layout manager; but gives you the most control cs java-spring2003-sklar-lect05 29

30 GUIs (5). listeners are interfaces you need to implement the appropriate listener(s), depending on what events you want to handle then you need to override each method in the interface e.g., for a KeyListener, you need: keypressed() keytyped() keyreleased() the body of a method can be empty, if you don t want to do anything when a given event occurs cs java-spring2003-sklar-lect05 30

31 events (1). an event represents some action on the part of the user user-generated events are entered either through the mouse or the keyboard examples: mouse pressed mouse released mouse clicked mouse entered mouse exited mouse moved mouse dragged cs java-spring2003-sklar-lect05 31

32 listeners (1). a listener is a part of a program that captures these events for processing in the program frequently, a listener interface is created for example, java.awt.event.mouselistener: void mousepressed( MouseEvent evt ); void mousereleased( MouseEvent evt ); void mouseclicked( MouseEvent evt ); void mouseentered( MouseEvent evt ); void mouseexited( MouseEvent evt ); what is a MouseEvent? Point getpoint(); int getx(); int gety(); int getclickcount(); cs java-spring2003-sklar-lect05 32

33 listeners (2). another example, java.awt.event.keylistener: void keypressed( KeyEvent evt ); void keyreleased( KeyEvent evt ); void keytyped( KeyEvent evt ); what is a KeyEvent? char getkeycode(); cs java-spring2003-sklar-lect05 33

34 GUI examples. MouseListener examples: Dots.java Dots2.java Dots3.java KeyListener examples: Dots4.java Dots5.java gui.java, snowflake.java cs java-spring2003-sklar-lect05 34

35 interfaces (1). an interface is a group of abstract methods that are defined by all classes that implement the interface an abstract method is one that does not have an implementation, i.e., there is no body of code for the method polymorphism means having many forms lets us use different implementations of a single interface binding happens when a particular implementation is locked to an interface this can happen at compile time or at run time an example of a run-time or dynamic binding is: ((Philosopher)current).pontificate(); from the example to follow cs java-spring2003-sklar-lect05 35

36 interfaces (2). public interface Speaker { public void speak(); public void announce( String str ); } // end of Speaker interface cs java-spring2003-sklar-lect05 36

37 interfaces (3). public class Philosopher implements Speaker { private String philosophy; public Philosopher ( String thoughts ) { philosophy = thoughts; } // end of Philosopher constructor public void speak () { System.out.println( philosophy ); } // end of Philosopher method speak public void announce ( String announcement ) { System.out.println( announcement ); } // end of Philosopher method announce public void pontificate() { for ( int i=0; i<5; i++ ) System.out.println( philosophy ); } // end of Philosopher method pontificate } // end of Philosopher class cs java-spring2003-sklar-lect05 37

38 interfaces (4). public class Dog implements Speaker { public void speak() { System.out.println( "woof" ); } // end of Dog method speak public void announce( String arf ) { System.out.println( "woof: " + arf ); } // end of Dog method announce } // end of class Dog cs java-spring2003-sklar-lect05 38

39 interfaces (5). public class Talking { public static void main( String[] args ) { Speaker current; current = new Dog(); current.speak(); current = new Philosopher( "I think, therefore I am." ); current.speak(); ((Philosopher)current).pontificate(); } // end of main() } // end of Talking class cs java-spring2003-sklar-lect05 39

40 exercise. look at the examples in the class web page: cs3101/examples/gallery.html copy the code for one of the snowman examples copy the code for the gui example replace the snowflake in the gui with the snowman change the components of the gui to do something interesting with the snowman cs java-spring2003-sklar-lect05 40

41 advanced graphics (1): fonts. fonts in Java are defined using the java.awt.font class you can see which fonts (by name) are available in your system by using the java.awt.graphicsenvironment.getallfonts() method you can get information about the point size of the font, whether it is italic, bold or plain you will most likely want to get the size of a string that might be drawn with the current font. first you need to create a FontMetrics object, then you can call the FontMetrics.stringWidth( String str ) method to find the width cs java-spring2003-sklar-lect05 41

42 advanced graphics (2): fonts, continued. useful font properties available in FontMetrics: ascent the distance from the font s baseline to the top of an alphanumeric character use int FontMetrics.getMaxAscent() descent the distance from the font s baseline to the bottom of an alphanumeric character with descenders use int FontMetrics.getMaxDescent() height the distance between the baseline of adjacent lines of text; the sum of the leading + ascent + descent. leading aka interline spacing; the logical amount of space to be reserved between the descent of one line of text and the ascent of the next line advance the distance from the leftmost point to the rightmost point on the string s baseline use int FontMetrics.charWidth( char ch ) to get the advance of the char argument cs java-spring2003-sklar-lect05 42

43 advanced graphics (3): images. you can load images from a URL and draw them load them using java.applet.getimage( URL url ) for an applet or java.awt.toolkit.getimage( URL url ) for an application draw them using Graphics.drawImage() this method there are a number of versions of note that an Image is a Java object unto itself, defined in the java.awt package also note that URL is a Java object that must be instantiated prior to using either of the getimage() methods cs java-spring2003-sklar-lect05 43

44 advanced graphics (4): animation. computer animation is kind of like an old-fashioned flip book you need to draw the object(s) being animated repeatedly, in each new location each time, you calculate the new position of the object(s) and redraw you can either redraw the entire scene or you can only redraw the object(s) that are moving but in the second case, you need to erase the object first, then move it to its new location and redraw the erasing part can be tricky if the background is not solid cs java-spring2003-sklar-lect05 44

45 advanced graphics (5): GridBagLayout. GridBagLayout you place components in the container in rows and columns you can specify the number of rows and columns you can specify the spacing between each row and/or column you can specify how a component is placed within its row/column, if it is smaller than the space allocated note that the height of an entire row is uniform, even if the components in each column are of different heights and the same for the width of a column all these are specified using a GridBagConstraints object cs java-spring2003-sklar-lect05 45

46 advanced graphics (6): GridBagLayout, continued. GridBagConstraints( int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets insets, int ipadx, int ipady ); gridx, gridy specify the location of the component, starting from (0,0) gridwidth, gridheight specify how many columns/rows the component occupies weightx, weighty specify how to distribute extra horizontal and vertical space anchor specifies where to place a component when it is smaller than its display area (e.g., CENTER, NORTH, NORTHEAST,...) fill specifies whether to resize a component if it is smaller than its display area (e.g., NONE, HORIZONTAL, VERTICAL, BOTH) insets specifies minimum amount of space between a component and the edges of its display area (external padding) ipadx, ipady specifies how much space to add to the minimum width and height of the component (internal padding) cs java-spring2003-sklar-lect05 46

Graphics Applets. By Mr. Dave Clausen

Graphics Applets. By Mr. Dave Clausen Graphics Applets By Mr. Dave Clausen Applets A Java application is a stand-alone program with a main method (like the ones we've seen so far) A Java applet is a program that is intended to transported

More information

Graphics Applets. By Mr. Dave Clausen

Graphics Applets. By Mr. Dave Clausen Graphics Applets By Mr. Dave Clausen Applets A Java application is a stand-alone program with a main method (like the ones we've seen so far) A Java applet is a program that is intended to transported

More information

OBJECT ORIENTED PROGRAMMING. Course 8 Loredana STANCIU Room B613

OBJECT ORIENTED PROGRAMMING. Course 8 Loredana STANCIU Room B613 OBJECT ORIENTED PROGRAMMING Course 8 Loredana STANCIU loredana.stanciu@upt.ro Room B613 Applets A program written in the Java programming language that can be included in an HTML page A special kind of

More information

TWO-DIMENSIONAL FIGURES

TWO-DIMENSIONAL FIGURES TWO-DIMENSIONAL FIGURES Two-dimensional (D) figures can be rendered by a graphics context. Here are the Graphics methods for drawing draw common figures: java.awt.graphics Methods to Draw Lines, Rectangles

More information

HTML Links Tutorials http://www.htmlcodetutorial.com/ http://www.w3.org/markup/guide/ Quick Reference http://werbach.com/barebones/barebones.html Applets A Java application is a stand-alone program with

More information

G51PRG: Introduction to Programming Second semester Applets and graphics

G51PRG: Introduction to Programming Second semester Applets and graphics G51PRG: Introduction to Programming Second semester Applets and graphics Natasha Alechina School of Computer Science & IT nza@cs.nott.ac.uk Previous two lectures AWT and Swing Creating components and putting

More information

AP CS Unit 12: Drawing and Mouse Events

AP CS Unit 12: Drawing and Mouse Events AP CS Unit 12: Drawing and Mouse Events A JPanel object can be used as a container for other objects. It can also be used as an object that we can draw on. The first example demonstrates how to do that.

More information

Graphics. Lecture 18 COP 3252 Summer June 6, 2017

Graphics. Lecture 18 COP 3252 Summer June 6, 2017 Graphics Lecture 18 COP 3252 Summer 2017 June 6, 2017 Graphics classes In the original version of Java, graphics components were in the AWT library (Abstract Windows Toolkit) Was okay for developing simple

More information

cs Java: lecture #6

cs Java: lecture #6 cs3101-003 Java: lecture #6 news: homework #5 due today little quiz today it s the last class! please return any textbooks you borrowed from me today s topics: interfaces recursion data structures threads

More information

9. APPLETS AND APPLICATIONS

9. APPLETS AND APPLICATIONS 9. APPLETS AND APPLICATIONS JAVA PROGRAMMING(2350703) The Applet class What is an Applet? An applet is a Java program that embedded with web content(html) and runs in a Web browser. It runs inside the

More information

11/7/12. Discussion of Roulette Assignment. Objectives. Compiler s Names of Classes. GUI Review. Window Events

11/7/12. Discussion of Roulette Assignment. Objectives. Compiler s Names of Classes. GUI Review. Window Events Objectives Event Handling Animation Discussion of Roulette Assignment How easy/difficult to refactor for extensibility? Was it easier to add to your refactored code? Ø What would your refactored classes

More information

Graphic User Interfaces. - GUI concepts - Swing - AWT

Graphic User Interfaces. - GUI concepts - Swing - AWT Graphic User Interfaces - GUI concepts - Swing - AWT 1 What is GUI Graphic User Interfaces are used in programs to communicate more efficiently with computer users MacOS MS Windows X Windows etc 2 Considerations

More information

The AWT Package, An Overview

The AWT Package, An Overview Richard G Baldwin (512) 223-4758, baldwin@austin.cc.tx.us, http://www2.austin.cc.tx.us/baldwin/ The AWT Package, An Overview Java Programming, Lecture Notes # 110, Revised 02/21/98. Preface Introduction

More information

PIC 20A GUI with swing

PIC 20A GUI with swing PIC 20A GUI with swing Ernest Ryu UCLA Mathematics Last edited: November 22, 2017 Hello swing Let s create a JFrame. import javax. swing.*; public class Test { public static void main ( String [] args

More information

Chapter 7 Applets. Answers

Chapter 7 Applets. Answers Chapter 7 Applets Answers 1. D The drawoval(x, y, width, height) method of graphics draws an empty oval within a bounding box, and accepts 4 int parameters. The x and y coordinates of the left/top point

More information

Unit 7: Event driven programming

Unit 7: Event driven programming Faculty of Computer Science Programming Language 2 Object oriented design using JAVA Dr. Ayman Ezzat Email: ayman@fcih.net Web: www.fcih.net/ayman Unit 7: Event driven programming 1 1. Introduction 2.

More information

Java Applet Basics. Life cycle of an applet:

Java Applet Basics. Life cycle of an applet: Java Applet Basics Applet is a Java program that can be embedded into a web page. It runs inside the web browser and works at client side. Applet is embedded in a HTML page using the APPLET or OBJECT tag

More information

CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM

CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM Objectives The objectives of this assignment are: to get your first experience with Java to become familiar with Eclipse Java

More information

Java - Applets. C&G criteria: 1.2.2, 1.2.3, 1.2.4, 1.3.4, 1.2.4, 1.3.4, 1.3.5, 2.2.5, 2.4.5, 5.1.2, 5.2.1,

Java - Applets. C&G criteria: 1.2.2, 1.2.3, 1.2.4, 1.3.4, 1.2.4, 1.3.4, 1.3.5, 2.2.5, 2.4.5, 5.1.2, 5.2.1, Java - Applets C&G criteria: 1.2.2, 1.2.3, 1.2.4, 1.3.4, 1.2.4, 1.3.4, 1.3.5, 2.2.5, 2.4.5, 5.1.2, 5.2.1, 5.3.2. Java is not confined to a DOS environment. It can run with buttons and boxes in a Windows

More information

Graphics and Painting

Graphics and Painting Graphics and Painting Lecture 17 CGS 3416 Fall 2015 November 30, 2015 paint() methods Lightweight Swing components that extend class JComponent have a method called paintcomponent, with this prototype:

More information

Appendix F: Java Graphics

Appendix F: Java Graphics Appendix F: Java Graphics CS 121 Department of Computer Science College of Engineering Boise State University August 21, 2017 Appendix F: Java Graphics CS 121 1 / 15 Topics Graphics and Images Coordinate

More information

Appendix F: Java Graphics

Appendix F: Java Graphics Appendix F: Java Graphics CS 121 Department of Computer Science College of Engineering Boise State University August 21, 2017 Appendix F: Java Graphics CS 121 1 / 1 Topics Graphics and Images Coordinate

More information

PESIT Bangalore South Campus

PESIT Bangalore South Campus INTERNAL ASSESSMENT TEST II Date : 20-09-2016 Max Marks: 50 Subject & Code: JAVA & J2EE (10IS752) Section : A & B Name of faculty: Sreenath M V Time : 8.30-10.00 AM Note: Answer all five questions 1) a)

More information

CHAPTER 2. Java Overview

CHAPTER 2. Java Overview Networks and Internet Programming (0907522) CHAPTER 2 Java Overview Instructor: Dr. Khalid A. Darabkh Objectives The objectives of this chapter are: To discuss the classes present in the java.awt package

More information

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics Topic 9: Swing Outline Swing = Java's GUI library Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 7: Expand moving shapes from Assignment 4 into game. "Programming

More information

Java - Applets. public class Buttons extends Applet implements ActionListener

Java - Applets. public class Buttons extends Applet implements ActionListener Java - Applets Java code here will not use swing but will support the 1.1 event model. Legacy code from the 1.0 event model will not be used. This code sets up a button to be pushed: import java.applet.*;

More information

(listener)... MouseListener, ActionLister. (adapter)... MouseAdapter, ActionAdapter. java.awt AWT Abstract Window Toolkit GUI

(listener)... MouseListener, ActionLister. (adapter)... MouseAdapter, ActionAdapter. java.awt AWT Abstract Window Toolkit GUI 51 6!! GUI(Graphical User Interface) java.awt javax.swing (component) GUI... (container) (listener)... MouseListener, ActionLister (adapter)... MouseAdapter, ActionAdapter 6.1 GUI(Graphics User Interface

More information

MaSH Environment graphics

MaSH Environment graphics MaSH Environment graphics Andrew Rock School of Information and Communication Technology Griffith University Nathan, Queensland, 4111, Australia a.rock@griffith.edu.au June 16, 2014 Contents 1 Purpose

More information

CSC System Development with Java Introduction to Java Applets Budditha Hettige

CSC System Development with Java Introduction to Java Applets Budditha Hettige CSC 308 2.0 System Development with Java Introduction to Java Applets Budditha Hettige Department of Statistics and Computer Science What is an applet? applet: a Java program that can be inserted into

More information

Chapter 14: Applets and More

Chapter 14: Applets and More Chapter 14: Applets and More Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 14 discusses the following main topics: Introduction to

More information

8/23/2014. Chapter Topics. Introduction to Applets. Introduction to Applets. Introduction to Applets. Applet Limitations. Chapter 14: Applets and More

8/23/2014. Chapter Topics. Introduction to Applets. Introduction to Applets. Introduction to Applets. Applet Limitations. Chapter 14: Applets and More Chapter 14: Applets and More Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 14 discusses the following main topics: Introduction to

More information

Method Of Key Event Key Listener must implement three methods, keypressed(), keyreleased() & keytyped(). 1) keypressed() : will run whenever a key is

Method Of Key Event Key Listener must implement three methods, keypressed(), keyreleased() & keytyped(). 1) keypressed() : will run whenever a key is INDEX Event Handling. Key Event. Methods Of Key Event. Example Of Key Event. Mouse Event. Method Of Mouse Event. Mouse Motion Listener. Example of Mouse Event. Event Handling One of the key concept in

More information

Graphics -- To be discussed

Graphics -- To be discussed Graphics -- To be discussed 1 Canvas Class... 1 2 Graphics Class... 1 3 Painting... 1 4 Color Models... 4 5 Animation's Worst Enemy: Flicker... 4 6 Working with Java Images... 5 6.1 Image Loading Chain

More information

1 Getting started with Processing

1 Getting started with Processing cisc3665, fall 2011, lab I.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For

More information

Java Programming Lecture 6

Java Programming Lecture 6 Java Programming Lecture 6 Alice E. Fischer Feb 15, 2013 Java Programming - L6... 1/32 Dialog Boxes Class Derivation The First Swing Programs: Snow and Moving The Second Swing Program: Smile Swing Components

More information

Using the API: Introductory Graphics Java Programming 1 Lesson 8

Using the API: Introductory Graphics Java Programming 1 Lesson 8 Using the API: Introductory Graphics Java Programming 1 Lesson 8 Using Java Provided Classes In this lesson we'll focus on using the Graphics class and its capabilities. This will serve two purposes: first

More information

Lecture 7 A First Graphic Program And Data Structures & Drawing

Lecture 7 A First Graphic Program And Data Structures & Drawing Lecture 7 A First Graphic Program And Data Structures & Drawing Objective The objective is that you will understand: How to program the generation of 2D and 3D images. How to manipulate those images through

More information

Lab 3: Work with data (IV)

Lab 3: Work with data (IV) CS2370.03 Java Programming Spring 2005 Dr. Zhizhang Shen Background Lab 3: Work with data (IV) In this lab, we will go through a series of exercises to learn some basics of working with data, including

More information

Programming: You will have 6 files all need to be located in the dir. named PA4:

Programming: You will have 6 files all need to be located in the dir. named PA4: PROGRAMMING ASSIGNMENT 4: Read Savitch: Chapter 7 and class notes Programming: You will have 6 files all need to be located in the dir. named PA4: PA4.java ShapeP4.java PointP4.java CircleP4.java RectangleP4.java

More information

Chapter 14: Applets and More

Chapter 14: Applets and More Chapter 14: Applets and More Starting Out with Java: From Control Structures through Objects Fourth Edition by Tony Gaddis Addison Wesley is an imprint of 2010 Pearson Addison-Wesley. All rights reserved.

More information

Java. GUI building with the AWT

Java. GUI building with the AWT Java GUI building with the AWT AWT (Abstract Window Toolkit) Present in all Java implementations Described in most Java textbooks Adequate for many applications Uses the controls defined by your OS therefore

More information

Chapter 12 Advanced GUIs and Graphics

Chapter 12 Advanced GUIs and Graphics Chapter 12 Advanced GUIs and Graphics Chapter Objectives Learn about applets Explore the class Graphics Learn about the classfont Explore the classcolor Java Programming: From Problem Analysis to Program

More information

Lecture 5: Java Graphics

Lecture 5: Java Graphics Lecture 5: Java Graphics CS 62 Spring 2019 William Devanny & Alexandra Papoutsaki 1 New Unit Overview Graphical User Interfaces (GUI) Components, e.g., JButton, JTextField, JSlider, JChooser, Containers,

More information

CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM

CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM Introduction to the Assignment In this assignment, you will get practice with recursion. There are three parts

More information

Chapter 3 - Introduction to Java Applets

Chapter 3 - Introduction to Java Applets 1 Chapter 3 - Introduction to Java Applets 2 Introduction Applet Program that runs in appletviewer (test utility for applets) Web browser (IE, Communicator) Executes when HTML (Hypertext Markup Language)

More information

Graphics and Java2D. Objectives

Graphics and Java2D. Objectives jhtp5_12.fm Page 569 Sunday, November 24, 2002 11:59 AM 12 Graphics and Java2D Objectives To understand graphics contexts and graphics objects. To understand and be able to manipulate colors. To understand

More information

10/16/2008. CSG 170 Round 5. Prof. Timothy Bickmore. User Analysis Task Analysis (6) Problem Scenarios (3)

10/16/2008. CSG 170 Round 5. Prof. Timothy Bickmore. User Analysis Task Analysis (6) Problem Scenarios (3) Human-Computer Interaction CSG 170 Round 5 Prof. Timothy Bickmore T2: Requirements Analysis Review User Analysis Task Analysis (6) Problem Scenarios (3) 1 T2 Review Requirements Analysis Who is the user?

More information

GUI in Java TalentHome Solutions

GUI in Java TalentHome Solutions GUI in Java TalentHome Solutions AWT Stands for Abstract Window Toolkit API to develop GUI in java Has some predefined components Platform Dependent Heavy weight To use AWT, import java.awt.* Calculator

More information

Introduction to the JAVA UI classes Advanced HCI IAT351

Introduction to the JAVA UI classes Advanced HCI IAT351 Introduction to the JAVA UI classes Advanced HCI IAT351 Week 3 Lecture 1 17.09.2012 Lyn Bartram lyn@sfu.ca About JFC and Swing JFC Java TM Foundation Classes Encompass a group of features for constructing

More information

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created. + Inheritance + Inheritance Classes that we design in Java can be used to model some concept in our program. For example: Pokemon a = new Pokemon(); Pokemon b = new Pokemon() Sometimes we need to create

More information

Lecture 3: Java Graphics & Events

Lecture 3: Java Graphics & Events Lecture 3: Java Graphics & Events CS 62 Fall 2017 Kim Bruce & Alexandra Papoutsaki Text Input Scanner class Constructor: myscanner = new Scanner(System.in); can use file instead of System.in new Scanner(new

More information

User interfaces and Swing

User interfaces and Swing User interfaces and Swing Overview, applets, drawing, action listening, layout managers. APIs: java.awt.*, javax.swing.*, classes names start with a J. Java Lectures 1 2 Applets public class Simple extends

More information

AplusBug dude = new AplusBug(); A+ Computer Science -

AplusBug dude = new AplusBug(); A+ Computer Science - AplusBug dude = new AplusBug(); AplusBug dude = new AplusBug(); dude 0x234 AplusBug 0x234 dude is a reference variable that refers to an AplusBug object. A method is a storage location for related program

More information

CSC207H: Software Design Lecture 11

CSC207H: Software Design Lecture 11 CSC207H: Software Design Lecture 11 Wael Aboelsaadat wael@cs.toronto.edu http://ccnet.utoronto.ca/20075/csc207h1y/ Office: BA 4261 Office hours: R 5-7 Acknowledgement: These slides are based on material

More information

Introduction to Java Applets 12

Introduction to Java Applets 12 Introduction to Java Applets 12 Course Map This module discusses the support for applets by the JDK, and how applets differ from applications in terms of program form, operating context, and how they are

More information

CSIS 10A Assignment 14 SOLUTIONS

CSIS 10A Assignment 14 SOLUTIONS CSIS 10A Assignment 14 SOLUTIONS Read: Chapter 14 Choose and complete any 10 points from the problems below, which are all included in the download file on the website. Use BlueJ to complete the assignment,

More information

CSC 1051 Data Structures and Algorithms I. Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University

CSC 1051 Data Structures and Algorithms I. Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Graphics & Applets CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/ Back to Chapter

More information

Java Coordinate System

Java Coordinate System Java Graphics Drawing shapes in Java such as lines, rectangles, 3-D rectangles, a bar chart, or a clock utilize the Graphics class Drawing Strings Drawing Lines Drawing Rectangles Drawing Ovals Drawing

More information

Java Applets. Last Time. Java Applets. Java Applets. First Java Applet. Java Applets. v We created our first Java application

Java Applets. Last Time. Java Applets. Java Applets. First Java Applet. Java Applets. v We created our first Java application Last Time v We created our first Java application v What are the components of a basic Java application? v What GUI component did we use in the examples? v How do we write to the standard output? v An

More information

Road Map. Introduction to Java Applets Review applets that ship with JDK Make our own simple applets

Road Map. Introduction to Java Applets Review applets that ship with JDK Make our own simple applets Java Applets Road Map Introduction to Java Applets Review applets that ship with JDK Make our own simple applets Introduce inheritance Introduce the applet environment html needed for applets Reading:

More information

An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a

An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a CBOP3203 An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a page. When you use a Java technology-enabled

More information

CSCI 053. Week 5 Java is like Alice not based on Joel Adams you may want to take notes. Rhys Price Jones. Introduction to Software Development

CSCI 053. Week 5 Java is like Alice not based on Joel Adams you may want to take notes. Rhys Price Jones. Introduction to Software Development CSCI 053 Introduction to Software Development Rhys Price Jones Week 5 Java is like Alice not based on Joel Adams you may want to take notes Objectives Learn to use the Eclipse IDE Integrated Development

More information

Command-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages.

Command-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages. 1 CS257 Computer Science I Kevin Sahr, PhD Lecture 14: Graphical User Interfaces Command-Line Applications 2 The programs we've explored thus far have been text-based applications A Java application is

More information

Some classes and interfaces used in this chapter from Java s original graphics capabilities and from the Java2D API.

Some classes and interfaces used in this chapter from Java s original graphics capabilities and from the Java2D API. CHAPTER 11 513 11 java.lang.object java.awt.color java.awt.component Key class interface java.awt.font java.awt.fontmetrics java.awt.graphics java.awt.polygon Classes and interfaces from the Java2D API

More information

BASICS OF GRAPHICAL APPS

BASICS OF GRAPHICAL APPS CSC 2014 Java Bootcamp Lecture 7 GUI Design BASICS OF GRAPHICAL APPS 2 Graphical Applications So far we ve focused on command-line applications, which interact with the user using simple text prompts In

More information

CS 201 Advanced Object-Oriented Programming Lab 1 - Improving Your Image Due: Feb. 3/4, 11:30 PM

CS 201 Advanced Object-Oriented Programming Lab 1 - Improving Your Image Due: Feb. 3/4, 11:30 PM CS 201 Advanced Object-Oriented Programming Lab 1 - Improving Your Image Due: Feb. 3/4, 11:30 PM Objectives The objectives of this assignment are: to refresh your Java programming to become familiar with

More information

2IS45 Programming

2IS45 Programming Course Website Assignment Goals 2IS45 Programming http://www.win.tue.nl/~wsinswan/programmeren_2is45/ Rectangles Learn to use existing Abstract Data Types based on their contract (class Rectangle in Rectangle.

More information

Event Driven Programming

Event Driven Programming Event Driven Programming 1. Objectives... 2 2. Definitions... 2 3. Event-Driven Style of Programming... 2 4. Event Polling Model... 3 5. Java's Event Delegation Model... 5 6. How to Implement an Event

More information

Programming graphics

Programming graphics Programming graphics Need a window javax.swing.jframe Several essential steps to use (necessary plumbing ): Set the size width and height in pixels Set a title (optional), and a close operation Make it

More information

Java Mouse Actions. C&G criteria: 5.2.1, 5.4.1, 5.4.2,

Java Mouse Actions. C&G criteria: 5.2.1, 5.4.1, 5.4.2, Java Mouse Actions C&G criteria: 5.2.1, 5.4.1, 5.4.2, 5.6.2. The events so far have depended on creating Objects and detecting when they receive the event. The position of the mouse on the screen can also

More information

Java & Graphical User Interface II. Wang Yang wyang AT njnet.edu.cn

Java & Graphical User Interface II. Wang Yang wyang AT njnet.edu.cn Java & Graphical User Interface II Wang Yang wyang AT njnet.edu.cn Outline Review of GUI (first part) What is Event Basic Elements of Event Programming Secret Weapon - Inner Class Full version of Event

More information

Graphical User Interfaces 2

Graphical User Interfaces 2 Graphical User Interfaces 2 CSCI 136: Fundamentals CSCI 136: Fundamentals of Computer of Science Computer II Science Keith II Vertanen Keith Vertanen Copyright 2011 Extending JFrame Dialog boxes Overview

More information

Graphical User Interface (GUI)

Graphical User Interface (GUI) Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware

More information

1 Getting started with Processing

1 Getting started with Processing cis3.5, spring 2009, lab II.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For

More information

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 5: Will be an open-ended Swing project. "Programming Contest"

More information

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun! Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Why are we studying Swing? 1. Useful & fun! 2. Good application of OOP techniques

More information

GUI DYNAMICS Lecture July 26 CS2110 Summer 2011

GUI DYNAMICS Lecture July 26 CS2110 Summer 2011 GUI DYNAMICS Lecture July 26 CS2110 Summer 2011 GUI Statics and GUI Dynamics 2 Statics: what s drawn on the screen Components buttons, labels, lists, sliders, menus,... Containers: components that contain

More information

CompSci 125 Lecture 17. GUI: Graphics, Check Boxes, Radio Buttons

CompSci 125 Lecture 17. GUI: Graphics, Check Boxes, Radio Buttons CompSci 125 Lecture 17 GUI: Graphics, Check Boxes, Radio Buttons Announcements GUI Review Review: Inheritance Subclass is a Parent class Includes parent s features May Extend May Modify extends! Parent

More information

SIMPLE APPLET PROGRAM

SIMPLE APPLET PROGRAM APPLETS Applets are small applications that are accessed on Internet Server, transported over Internet, automatically installed and run as a part of web- browser Applet Basics : - All applets are subclasses

More information

UNIT -1 JAVA APPLETS

UNIT -1 JAVA APPLETS UNIT -1 JAVA APPLETS TOPICS TO BE COVERED 1.1 Concept of Applet Programming Local and Remote applets Difference between applet and application Preparing to write applets Building applet code Applet life

More information

Graphical User Interface (GUI)

Graphical User Interface (GUI) Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware

More information

Creating Rich GUIs in Java. Amy Fowler Staff Engineer JavaSoft

Creating Rich GUIs in Java. Amy Fowler Staff Engineer JavaSoft 1 Creating Rich GUIs in Java Amy Fowler Staff Engineer JavaSoft 2 Tutorial Overview Toolkit principles & architecture GUI layout management Building custom components AWT futures 3 Toolkit Principles &

More information

@Override public void start(stage primarystage) throws Exception { Group root = new Group(); Scene scene = new Scene(root);

@Override public void start(stage primarystage) throws Exception { Group root = new Group(); Scene scene = new Scene(root); Intro to Drawing Graphics To draw some simple graphics, we first need to create a window. The easiest way to do this in the current version of Java is to create a JavaFX application. Previous versions

More information

Graphics in Swing. Engineering 5895 Faculty of Engineering & Applied Science Memorial University of Newfoundland

Graphics in Swing. Engineering 5895 Faculty of Engineering & Applied Science Memorial University of Newfoundland Graphics in Swing Engineering 5895 Faculty of Engineering & Applied Science Memorial University of Newfoundland 1 paintcomponent and repaint Each Swing component has the following paint methods: void paintcomponent(

More information

CS1004: Intro to CS in Java, Spring 2005

CS1004: Intro to CS in Java, Spring 2005 CS4: Intro to CS in Java, Spring 25 Lecture #8: GUIs, logic design Janak J Parekh janak@cs.columbia.edu Administrivia HW#2 out New TAs, changed office hours How to create an Applet Your class must extend

More information

Java TM Applets. Rex Jaeschke

Java TM Applets. Rex Jaeschke Java TM Applets Rex Jaeschke Java Applets 1997 1998, 2009 Rex Jaeschke. All rights reserved. Edition: 3.0 (matches JDK1.6/Java 2) All rights reserved. No part of this publication may be reproduced, stored

More information

Course Status Networking GUI Wrap-up. CS Java. Introduction to Java. Andy Mroczkowski

Course Status Networking GUI Wrap-up. CS Java. Introduction to Java. Andy Mroczkowski CS 190 - Java Introduction to Java Andy Mroczkowski uamroczk@cs.drexel.edu Department of Computer Science Drexel University March 10, 2008 / Lecture 8 Outline Course Status Course Information & Schedule

More information

The Java Programming Language Basics. Identifiers, Keywords, and Types. Expressions and Flow Control. Object-Oriented Programming. Objects and Classes

The Java Programming Language Basics. Identifiers, Keywords, and Types. Expressions and Flow Control. Object-Oriented Programming. Objects and Classes Building GUIs 8 Course Map This module covers setup and layout of graphical user interfaces. It introduces the Abstract Windowing Toolkit, a package of classes from which GUIs are built. Getting Started

More information

Building Java Programs

Building Java Programs Building Java Programs Graphics reading: Supplement 3G videos: Ch. 3G #1-2 Objects (briefly) object: An entity that contains data and behavior. data: variables inside the object behavior: methods inside

More information

Virtualians.ning.pk. 2 - Java program code is compiled into form called 1. Machine code 2. native Code 3. Byte Code (From Lectuer # 2) 4.

Virtualians.ning.pk. 2 - Java program code is compiled into form called 1. Machine code 2. native Code 3. Byte Code (From Lectuer # 2) 4. 1 - What if the main method is declared as private? 1. The program does not compile 2. The program compiles but does not run 3. The program compiles and runs properly ( From Lectuer # 2) 4. The program

More information

Applets and the Graphics class

Applets and the Graphics class Applets and the Graphics class CSC 2014 Java Bootcamp Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Some slides in this presentation are adapted from the slides accompanying

More information

Lab 10: Inheritance (I)

Lab 10: Inheritance (I) CS2370.03 Java Programming Spring 2005 Dr. Zhizhang Shen Background Lab 10: Inheritance (I) In this lab, we will try to understand the concept of inheritance, and its relation to polymorphism, better;

More information

Programmierpraktikum

Programmierpraktikum Programmierpraktikum Claudius Gros, SS2012 Institut für theoretische Physik Goethe-University Frankfurt a.m. 1 of 18 17/01/13 11:46 Java Applets 2 of 18 17/01/13 11:46 Java applets embedding Java applications

More information

Using Graphics. Building Java Programs Supplement 3G

Using Graphics. Building Java Programs Supplement 3G Using Graphics Building Java Programs Supplement 3G Introduction So far, you have learned how to: output to the console break classes/programs into static methods store and use data with variables write

More information

Graphical User Interfaces (GUIs)

Graphical User Interfaces (GUIs) CMSC 132: Object-Oriented Programming II Graphical User Interfaces (GUIs) Department of Computer Science University of Maryland, College Park Model-View-Controller (MVC) Model for GUI programming (Xerox

More information

Here is a list of a few of the components located in the AWT and Swing packages:

Here is a list of a few of the components located in the AWT and Swing packages: Inheritance Inheritance is the capability of a class to use the properties and methods of another class while adding its own functionality. Programming In A Graphical Environment Java is specifically designed

More information

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 9: Writing Java Applets. Introduction

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 9: Writing Java Applets. Introduction INTRODUCTION TO COMPUTER PROGRAMMING Richard Pierse Class 9: Writing Java Applets Introduction Applets are Java programs that execute within HTML pages. There are three stages to creating a working Java

More information

(Refer Slide Time: 02:01)

(Refer Slide Time: 02:01) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #29 Java Applets Part: 2 In this lecture we shall be continuing

More information

Java How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 9/e Copyright 1992-2012 by Pearson Education, Inc. All Rights Reserved. Overview capabilities for drawing two-dimensional shapes, controlling colors and controlling fonts. One of

More information

Sri Vidya College of Engineering & Technology

Sri Vidya College of Engineering & Technology UNIT-V TWO MARKS QUESTION & ANSWER 1. What is the difference between the Font and FontMetrics class? Font class is used to set or retrieve the screen fonts.the Font class maps the characters of the language

More information