Error: cannot find symbol
symbol: method pushButton(int)
location: variable selectedRadio of type Radio
and I've tried everything to fix it. Also have the same issue with the setButton method too.
public class AutoMusicSystem
{
private static int MAX_BUTTONS = 6;
Radio selectedRadio = null;
private AMRadio radioAM = new AMRadio();
private FMPushButtonRadio radioFM1 = new FMPushButtonRadio();
private FMPushButtonRadio radioFM2 = new FMPushButtonRadio();
AutoMusicSystem()
{
radioFM1 = new FMPushButtonRadio(MAX_BUTTONS);
radioFM2 = new FMPushButtonRadio(MAX_BUTTONS);
selectedRadio = radioAM;
}
/*
*
*
*/
public void up()
{
selectedRadio.up();
}
/*
*
*
*/
public void down()
{
selectedRadio.down();
}
/*
*
*
*/
public double getCurrentFrequency()
{
double getFreq = selectedRadio.getCurrentFrequency();
return getFreq;
}
/*
*
*
*/
public String toString()
{
String temp = "";
if (selectedRadio == radioAM)
{
temp = temp+"(AM) ";
}
else if (selectedRadio==radioFM1)
{
temp = temp+"(FM1) ";
}
else
temp = temp+"(FM2) ";
return temp+ selectedRadio.toString() ;
}
/*
*
* Sets the current frequency to the button
*/
public void setButton(int buttonNumber)
{
// selectedRadio.setButton();
}
/*
*
* Change the current radio button
*/
public void pushButton(int buttonNumber)
{
selectedRadio.pushButton(buttonNumber);
}
/*
*
*
*/
public void pushSelector()
{
//if(selectedRadio == radioAm)
}
}

New Topic/Question
Reply



MultiQuote




|