Fancy Text Application - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Fancy Text Application

Description:

Font= new Font('Verdana',Font.BOL,50); 4. Initialize Values ... The drawString method from the Graphics object sets the color and font ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 7
Provided by: swea9
Category:
Tags: application | bol | fancy | text

less

Transcript and Presenter's Notes

Title: Fancy Text Application


1
Fancy Text Application
  • Chapter 3

2
Fancy Text 3
  • Class FancyText3
  • Creates class
  • Member Variables make up the next line of code
  • private Font font
  • private String msg
  • private Color color Color.blue
  • private int x100
  • private int y100

3
Add a Constructor
  • The Constructor class creates the object
  • Uninitialized fields set in Constructor
  • MsgtheMessage
  • Font new Font(Verdana,Font.BOL,50)

4
Initialize Values
  • The mutator method is used to initialize values
    for attributes.
  • public void setColor(Color c)
  • colorc

5
Graphics
  • The drawString method from the Graphics object
    sets the color and font
  • public void drawFancyString(Graphics g)
  • g.setColor(color)

6
Test Program
  • A test program instantiages a FancyText3object
  • Draws the string using default values
  • Next test program will set new values using the
    mutators
  • Then call drawFancyString() again
Write a Comment
User Comments (0)
About PowerShow.com