我有一个带有一些项目的JList.我已经为选择列表中的项目时添加了一个监听器.以下是选择列表中的项目时会发生什么的代码:
private void questionaireNamesListValueChanged(ListSelectionEvent evt) {
try {
inputPanel.setEnabled(false);
inputPanel.setVisible(false);
inputTextField.setText("");
inputStatusLabel.setText("");
int questionaireIndex = questionaireNamesList.getSelectedIndex();
// Why will this be printed twice?
System.out.println("Questionaire Index: " + questionaireIndex);
if (remoteQuestionServer.getQuestionCount(questionaireIndex) == 5) {
answerQuestionButton.setEnabled(true);
addQuestionButton.setEnabled(false);
} else {
addQuestionButton.setEnabled(true);
answerQuestionButton.setEnabled(false);
}
} catch (RemoteException ex) {
ex.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
你可以在上面我发表一个System.out.print声明,每当我点击列表中的某些内容时,我就会获得该项目的两个输出,例如.
Questionaire Index: 4
Questionaire Index: 4
Questionaire Index: 2
Questionaire Index: 2
Questionaire Index: 0
Questionaire Index: 0
Questionaire Index: 2
Questionaire Index: 2
Run Code Online (Sandbox Code Playgroud)
知道为什么会这样吗?
谢谢,帕特里克
具有以下内容ivy.xml:
<dependency org="com.amazonaws" name="aws-java-sdk" rev="1.4.5">
<artifact name="aws-java-sdk" ext="jar"/>
</dependency>
Run Code Online (Sandbox Code Playgroud)
它会下载aws-java-sdk-1.4.5.jar,这是 AWS SDK,即类。
很好,但我还想获得 Javadoc 和源代码。
遵循Ivy: Fetching Javadocs and Sources 的建议,我将以下内容放入ivy.xml
<configurations>
<conf name="default" />
<conf name="compile" visibility="public"/>
<conf name="sources" visibility="public"/>
<conf name="javadoc" visibility="public"/>
</configurations>
<dependency org="com.amazonaws" name="aws-java-sdk"
rev="1.4.5" transitive="true"
conf="javadoc->javadoc;sources->sources;compile->default"/>
Run Code Online (Sandbox Code Playgroud)
aws-java-sdk-1.4.5.jar 它仅下载,并且是Javadoc(无类或源文件)。
更新:可能有用的文件片段
<project name="aws-project" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<target name="build" depends="clean,configure-ivy-settings,artifactory-retrieve">
Run Code Online (Sandbox Code Playgroud)
<project name="artifactory-bootstrap" xmlns:ac="http://ant-contrib.sourceforge.net" xmlns:ivy="antlib:org.apache.ivy.ant" default="configure-ivy-settings">
<target name="configure-ivy-settings" unless="skip.artifact.retrieve">
<echoproperties prefix="ivy" />
<!-- Change this to …Run Code Online (Sandbox Code Playgroud)