4.14 (Optional) GUI and Graphics Case Study: Creating Simple Drawings
An appealing feature of Java is its graphics support, which enables you to visually enhance your applications. We now introduce one of Java’s graphical capabilities—drawing lines. It also covers the basics of creating a window to display a drawing on the computer screen.
Java’s Coordinate System
To draw in Java, you must understand Java’s coordinate system (Fig. 4.17), a scheme for identifying points on the screen. By default, the upper-left corner of a GUI component
has the coordinates (0, 0). A coordinate ...
Get Java How to Program (early objects), 9/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.