import java.awt.*;
import javax.swing.*;
public class Test extends JApplet
{
JTextField xfield1 ;
JLabel xLabel1 ;
Container con;
public void init()
{
con=getContentPane();
con.setLayout(new FlowLayout());
xfield1 = new JTextField(12);
xLabel1 = new JLabel("请输入X1坐标");
con.add(xLabel1);
con.add(xfield1);
}
public void paintComponent(Graphics g) // not paintComponet -- why
{
super.paintComponent(g); // not paintComponents,
// and I don't think JApplet has paintComponent(Graphics) -- why
g.drawLine(20,20,50,100);
}
}
你这是马虎! // then how about yourself -- why;-)