/** * 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 Color bg; // background colour transparent white hfbrx_swing hf; boolean FrequenciesLoaded = false; int w, h, y; // panel's width and height font vertical baseline offset Font font; // font for panel lettering squelchpanel(int w, int h, int y, Font font, hfbrx_swing hf, Color bg) { this.w = w; this.h = h; this.font = font; this.y = y; this.hf = hf; this.bg = bg; } // 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); // display the confirmation field in black // display the lettering g.drawString((String)hf.squelch.getSelectedItem(),4,y); } public void update(Graphics g) { paint(g); } }