GUI questions
Currently I am using JDK 1.2.1.
Consider the following simple coding:
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Stroke;
import java.awt.BasicStroke;
import java.applet.*;
public class Stroke01 extends Applet {
public void init() {
}
public void paint(Graphics g) {
Graphics2D twoD = (Graphics2D)g;
BasicStroke pen = new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND);
twoD.setStroke(pen);
}
}
When I try to embed the applet to HTML page, it diplays nothing when I run the browser. Why is it happen? Is Graphics2D not supported in JDK 1.2.1? Because whenever I use 2D effect, the actual output will not be displayed.
|