/** * 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 { private static final Font // medium font for annotating font = new Font("Sans",Font.BOLD,13); // the vertical £ scale public void paint(Graphics g) { int y = 6; // starting value for vertical graticule increment g.setFont(font); // use the above font for doing the annotations g.setColor(Color.black); // draw everything in black for(int i = 0; i < 6; i++) { // for each £1000 graduation g.drawString("£" + (5 - i) + "k",0,y + 5); // vertical annotation g.drawLine(28,y,33,y); // vertical annotation mark y += 40; // accumulated number of £s (scaled) } g.drawLine(33,6,33,206); // vertical axis } }