/** * Current Account Balances: Graphical Display Applet * @author Robert J Morton * @version 12 July 2000, 23 April 2012 * @copyright July 2000 Robert J Morton (all rights reserved) */ // THE PANEL ON WHICH THE VERTICAL MONEY SCALE iS DISPLAYED import java.awt.*; // for graphics operations (GUI) import javax.swing.*; // swing GUI widgets library public class pscale extends JPanel { // medium font for annotating the vertical £ scale private static final Font font = new Font("Sans",Font.BOLD,13); public void paint(Graphics g) { int y = 6; // starting value for vertical graticule increment g.setFont(font); // Set up the medium font g.setColor(Color.black); // to print in black lettering. /* For each £1000 graduation, draw the vertical annotation and the vertical annotation mark then increment the accumulated number of £s (scaled). */ for(int i = 0; i < 6; i++) { g.drawString("£" + (5 - i) + "k", 0, y + 5); g.drawLine(28,y,33,y); y += 40; } g.drawLine(33, 6, 33, 206); // draw the vertical axis } }