嘿家伙得到这个错误:你们可以尝试解决这个问题吗?或者看到什么是错误的修复或其他东西
非常感谢你的家伙:)
Exception in thread "ExtensionHandler-1" java.lang.NoSuchMethodE
rror: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/Concu
rrentHashMap$KeySetView;
at aerivial.requests.aqw.GetAction.process(GetAction.java:196)
at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.processEve
nt(ExtensionHandler.java:535)
at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.run(Extens
ionHandler.java:344)
at java.lang.Thread.run(Thread.java:619)
Run Code Online (Sandbox Code Playgroud)
错误代码:
ConcurrentHashMap tgtBuffDebuffs = (ConcurrentHashMap)userTgt.properties.get(Users.BUFFS_DEBUFFS);
for (Iterator i = tgtBuffDebuffs.keySet().iterator(); i.hasNext(); ) { int auraId = ((Integer)i.next());
Aura aura = (Aura)World.instance.auras.get(Integer.valueOf(auraId));
if ((aura.getDamage() >= 0.0D) && (!aura.getCategory().equals("d"))) {
damage = (int)(damage * aura.getDamage());
}
}
Run Code Online (Sandbox Code Playgroud) 嗨所以我试图让这个事件发生变化,因为某些原因状态更新它不允许我编译它给出错误:
The event 'Entity.StateChanged' can only appear on the left hand side of += or -=
Run Code Online (Sandbox Code Playgroud)
我不知道什么是错的似乎我试过谷歌它没有帮助
public Entity.State state
{
get
{
return this._state;
}
set
{
if (this._state != value)
{
this._state = value;
this.OnStateChanged();
}
}
}
protected virtual void OnStateChanged()
{
if (this.StateChanged != null)
{
this.StateChanged();
}
}
public event Action StateChanged
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
this.StateChanged += value;
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
this.StateChanged -= value;
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢你们的时间和帮助!
我试图隐藏除从jcomboBox的索引(cbLists)中获得的1以外的所有jList,它并没有真正隐藏它像禁用而不是隐藏的jList,我需要它隐藏所有像完全不可见的1这是我正在尝试的代码:
package javaapplication2;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Form1 extends javax.swing.JFrame {
public Form1() {
initComponents();
ActionListener actionListener = (ActionEvent e) -> {
System.out.println("Selected: " + cbLists.getSelectedItem());
System.out.println(", Position: " + cbLists.getSelectedIndex());
setCB(cbLists.getSelectedIndex());
};
cbLists.addActionListener(actionListener);
}
private void setCB(int index) {
switch (index) {
case 1:
jList1.setVisible(false);
jList4.setVisible(false);
jList3.setVisible(false);
jList2.setVisible(true);
break;
case 2:
jList1.setVisible(false);
jList2.setVisible(false);
jList3.setVisible(true);
jList4.setVisible(false);
break;
case 3:
jList1.setVisible(false);
jList2.setVisible(false);
jList3.setVisible(false);
jList4.setVisible(true);
break;
default:
jList1.setVisible(true);
jList2.setVisible(false);
jList3.setVisible(false);
jList4.setVisible(false);
break;
}
}
/**
* This method is called …Run Code Online (Sandbox Code Playgroud)