home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java by Example
/
jbecd.bin
/
JBE-CD
/
NTUsers
/
JBECODE.ZIP
/
JavaByExample
/
chap16
/
ArcApplet.java
< prev
next >
Wrap
Text File
|
1996-02-21
|
755b
|
37 lines
import java.awt.*;
import java.applet.*;
public class ArcApplet extends Applet
{
TextField textField1, textField2;
public void init()
{
textField1 = new TextField(10);
textField2 = new TextField(10);
add(textField1);
add(textField2);
textField1.setText("0");
textField2.setText("360");
}
public void paint(Graphics g)
{
String s = textField1.getText();
int start = Integer.parseInt(s);
s = textField2.getText();
int sweep = Integer.parseInt(s);
g.drawArc(35, 50, 125, 180, start, sweep);
}
public boolean action(Event event, Object arg)
{
repaint();
return true;
}
}