public void paintComponent(Graphics g)
  {
          System.out.println("*****************");//你写这条测试语句就会发现你的paintComponent方法在无穷执行,你明白了吗???
          super.paintComponent(g);
 setForeground(Color.green);
 g.drawLine(0,bottom,1000,bottom);
 setForeground(Color.red);
 g.drawLine(0,bottom,1000,bottom);
 }