java 无法通过方法调用转换将实际参数 转换为.代码如下:
importjava.awt.*;importjava.applet.*;importjava.awt.event.*;importjavax.swing.JOption...
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.JOptionPane;
public class Changecolor extends Applet implements Actionlistener
{
Button bt1=new Button("中");
public void init()
{
bt1.addActionListener(this);
setLayout(new BorderLayout());
add("East",new Button("东"));
add("South",new Button("南"));
add("West",new Button("西"));
add("North",new Button("北"));
add("Center",bt1);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==bt1)
JOptionPane.showMessageDialog(null,"you press the center button");
System.exit(0);
}
} 展开
import java.applet.*;
import java.awt.event.*;
import javax.swing.JOptionPane;
public class Changecolor extends Applet implements Actionlistener
{
Button bt1=new Button("中");
public void init()
{
bt1.addActionListener(this);
setLayout(new BorderLayout());
add("East",new Button("东"));
add("South",new Button("南"));
add("West",new Button("西"));
add("North",new Button("北"));
add("Center",bt1);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==bt1)
JOptionPane.showMessageDialog(null,"you press the center button");
System.exit(0);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询