import javax.swing.*;
import java.awt.*;
public class Test
{
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
NotFrame frame=new NotFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
}
}
class NotPanel extends JPanel
{

public void paintComponet(Graphics g)  //这个函数如何被调用呢,才能让panel显示"Not Hello World"字样???
{
g.drawString("Not Hello World",X,Y);
}

public static final int X=75;
public static final int Y=100;
}
class NotFrame extends JFrame
{
public NotFrame()
{
setTitle("Not");
setSize(W,H);
NotPanel panel=new NotPanel();
add(panel);
}
public static final int W=300;
public static final int H=200;}
执行完毕之后,跟本没出现"Not Hello World"字样,在我检查程序后发现,原程序根本没去调用NotPanel类的paintComponet()这个方法.但我又不知如何去调用它,请指教.