我想从this.s
方法访问actionPerformed
变量,并在addSignTag
方法中使用它。
我怎么做?对不起重新发布!
String s;
public void actionPerformed(ActionEvent e)
{
int index = 0;
int connectorCoorX = MyGraphics.prevX;
int connectorCoorY = MyGraphics.prevY;
Way w = new Way();
if(e.getActionCommand().equals("Check")){
index = list.getSelectedIndex();
System.out.println("Index selected" + index);
this.s= (String) list.getSelectedValue();
System.out.println("Value Selected " +this.s);
createMap();
}
}
public void addSignTag(Way w, String tagKey, String valueKey)
{ String key = Tag.removeWhiteSpaces(tagKey);
String value = Tag.removeWhiteSpaces(valueKey);
if (key.isEmpty() || value.isEmpty())
return;
}