这是用于调用方法的代码:
public void landingGearConditions(MouseEvent event)
{
if (event.getButton() == MouseEvent.BUTTON1)
System.out.println("landing gear activated");
paintGears();
if (event.getButton() == MouseEvent.BUTTON3)
System.out.println("landing gear retracted");
paintRetractedGears();
}
这是用于油漆前后轮胎的代码:
private void paintGears(Graphics page)
{
super.paintComponent(page);
page.setColor(Color.black); //set color for the tires
page.fillOval(planex+126,planey+75,16,16); //front tire
page.fillOval(planex+275,planey+79,16,16); //back tire
}
private void paintRetractedGears(Graphics page)
{
super.paintComponent(page);
page.setColor(Color.blue); //set color for the tires
page.fillOval(planex+126,planey+75,16,16); //front tire
page.fillOval(planex+275,planey+79,16,16); //back tire
}
错误的含义是,“ Plane2类型的方法paintRetractedGears(java.awt.Graphics)不适用于参数()”