我对Java ActionEvent有问题,因为我的代码很大。
我知道这个错误:
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem:
The code of method actionPerformed(ActionEvent) is exceeding the 65535 bytes limit我尝试过多种想法,但没有什么效果,例如:
我又加了一个ActionEvent
public void actionPerformed(ActionEvent ae) {但有错误:
Duplicate method actionPerformed(ActionEvent)Eclipse向我显示,重命名方法tp "actionPerformed2“。如果我这样做,代码就会工作,但是如果我按下按钮,什么都不会发生,就像这样:
public void actionPerformed2(ActionEvent ae) {
if(ae.getSource() == jbtnBuildCarLv1){发布于 2016-03-03 17:11:40
既然这条消息只是告诉你你的方法太长了,就把它分开。
另外,您不能只有两个方法具有相同的名称,但如果您重命名一个,它将不会被调用,除非您手动这样做。
https://stackoverflow.com/questions/35778521
复制相似问题