Motion Tracking (4)

    // Tracker continues
    private void showGeometry(ComponentEvent e) {
        Component c = e.getComponent();
        Dimension d = c.getSize();
        Point p = c.getPosition();

        label.setText("Position: (" + p.x +
                     "," + p.y + ")\nSize: )" +
                     d.width + "," + d.height + ")");
    }
}


Slide 45 ©Copyright 1997 Jan Newmarch