home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java by Example
/
jbecd.bin
/
JBE-CD
/
NTUsers
/
JBECODE.ZIP
/
JavaByExample
/
chap26
/
ConfigApplet2.java
< prev
next >
Wrap
Text File
|
1996-03-13
|
714b
|
36 lines
import java.awt.*;
import java.applet.*;
public class ConfigApplet2 extends Applet
{
String str;
Point position;
public void init()
{
String s;
str = getParameter("text");
s = getParameter("typesize");
int typeSize = Integer.parseInt(s);
s = getParameter("xpos");
int xpos = Integer.parseInt(s);
s = getParameter("ypos");
int ypos = Integer.parseInt(s);
position = new Point(xpos, ypos);
Font font = new Font("TimesRoman", Font.BOLD, typeSize);
setFont(font);
}
public void paint(Graphics g)
{
g.drawString(str, position.x, position.y);
}
}