求解 Graphics g=e.getComponent().getGraphics() 的意思

public void mouseReleased(MouseEvent e) {
        // TODO Auto-generated method stub
        Graphics g=e.getComponent().getGraphics();
        g.setColor(Color.RED);
        g.drawLine(x, y, e.getX(), e.getY());
    }

我是想利用Graphics g=e.getComponent().getGraphics() 画直线,可对于Graphics g=e.getComponent().getGraphics() 有些不解。

获取图形上下文

摆好画布找支笔