62,620
社区成员
发帖
与我相关
我的任务
分享
public class ButtonTestApplet extends JApplet
{
private static final long serialVersionUID = 1L;
public void init()
{
setLayout(new BorderLayout());
JPanel panel = new JPanel();
JButton yellowButton = new JButton("Yellow");
yellowButton.addActionListener(yellowAction(panel));
panel.add(yellowPanel);
add(panel, BorderLayout.SOUTH);
}
static
{
System.loadLibrary("calldll");
}
public native int shanfei(int i);
private ActionListener yellowAction(final JPanle panel)
{
return new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
panel.setBackground(Color.yellow);//执行到此都正确
ButtonTestApplet jc = new ButtonTestApplet();
int j;
j = jc.shanfei(4);//提示出错
JOptionPane.showMessengeDialog(panel, j);
}
}
}
}