/** * HF Receiver Controller Applet 1.0.0 * @author Robert J Morton YE572246C * @version 25 November 2001, revanped 16 November 2007, Swing Version 31 January 2012 * @copyright Robert J Morton (all rights reserved) */ /* This is the Applet's Squelch Control panel */ import javax.swing.*; // the Swing GUI system import java.awt.*; // abstract windiwing toolkit public class squelchpanel extends JPanel { private static final long serialVersionUID = 130L; // what the hell this is for, I don't know! private hfbrx hf; private String SquelchLevel = "5"; private Color bg; // background colour transparent white int w, h, y; // panel's width & height font vertical baseline offset Font font; // font for panel lettering squelchpanel(int w, int h, int y, Font font, hfbrx hf, Color bg) { this.w = w; // width of S panel this.h = h; // height of S panel this.font = font; // font for S panel this.y = y; // bas of panel lettering this.hf = hf; this.bg = bg; // background colour for panel } void setSquelch(String s) {SquelchLevel = s; repaint();} // (RE)DISPLAY THE SQUELCH-LEVEL CONFORMATION FIELD public void paint(Graphics g) { g.setColor(bg); // clear the field by g.fillRect(0,0,w,h); // filling it with background colour g.setFont(font); // use the big bold font g.setColor(Color.black); // lettering colour g.drawString(SquelchLevel,4,y); // display the lettering } }