import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.*; import javax.swing.border.*; public class program5 extends fan{ private int k; static int x = 360; private JRadioButton high; private JRadioButton medium; private JRadioButton low; private JRadioButton off; public program5(){ Timer timer = new Timer(10, tL); timer.start(); } public void sR(int s){ k = getRate(); } public int gR(){ return k; } private class tL implements ActionListener{ private program5 p; public tL(program5 smellyassholes) { p=smellyassholes; } public void actionPerformed(ActionEvent e){ //setCurrentTime(); if(x > 0) x -= gR(); //0 for off, 6 for low, 10 for medium, 20 for high. else x=360; setRate(x); repaint(); } } public static void main(String[] args){ JFrame frame = new JFrame("asdasdasd fan"); program5 p5 = new program5(); test test1 = new test(); frame.add(p5, BorderLayout.CENTER); frame.add(test1, BorderLayout.SOUTH); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(320, 240); frame.setVisible(true); } }