Java 找不到方法getComponent()

Java 找不到方法getComponent(),java,jsf,jsf-2,Java,Jsf,Jsf 2,我想实现带有分页和排序的JSF页面。不幸的是,当使用getComponent()时,Netbeans向我显示错误: cannot find symbol symbol: method getComponent() location: variable event of type java.awt.event.ActionEvent 我尝试导入依赖项java.awt.event.ActionEvent,但没有任何更改。这是使用getComponent()的代码 public voi

我想实现带有分页和排序的JSF页面。不幸的是,当使用
getComponent()
时,Netbeans向我显示错误:

cannot find symbol
  symbol:   method getComponent()
  location: variable event of type java.awt.event.ActionEvent 
我尝试导入依赖项java.awt.event.ActionEvent,但没有任何更改。这是使用
getComponent()
的代码

public void page(ActionEvent event) {
        page(((Integer) ((UICommand) event.getComponent()).getValue() - 1) * rowsPerPage);
    }
使用
getComponent()
需要哪些依赖项?我可以用类似的方法替换这个Java方法吗


最好的祝愿

您导入了错误的
ActionEvent
,您需要导入

javax.faces.event.ActionEvent

请参见

您导入了错误的
ActionEvent
,您需要导入

javax.faces.event.ActionEvent