JPANEL和PANEL有什么不用,为什么在PANEL上画图没问题,变成JPANEL就不显示了?//PANEL
public void paintNode(Graphics g, Node n, FontMetrics fm) {
int x = (int) n.getX();
int y = (int) n.getY();
g.setColor((n == pick) ? selectColor : (n.isFixed() ? fixedColor
: nodeColor));
int w = fm.stringWidth(n.getLbl()) + 10;
int h = fm.getHeight() + 4;
g.fillRect(x - w / 2, y - h / 2, w, h);
g.setColor(Color.black);
g.drawRect(x - w / 2, y - h / 2, w - 1, h - 1);
g.drawString(n.getLbl(), x - (w - 10) / 2, (y - (h - 4) / 2)
+ fm.getAscent());

repaint();
}
JPANEL就是不能显示 怪阿!