我正在尝试找出如何删除所选"播放器的代码"和"得分"。我有设置按钮创建的表单。添加播放器按钮,添加播放器+他们的分数,我创建了一个名为btnRemove
的按钮,我希望它从原始数据中删除选定的播放器。这是我的代码。
private void btnAddPlayerActionPerformed(java.awt.event.ActionEvent evt) {
// read artist and title and add to the list
String artist = txtName.getText();
String title = txtScore.getText();
//add it to the list
playerLib.add(artist, title);
//display our data in the raw list - debugging/testing only
lstRaw.add(artist + ", " + title);
}
private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void btnRemoveActionPerformed(java.awt.event.ActionEvent evt) {
//code to delete player
}
任何帮助将不胜感激。