1
if(incasationBegin > 0)
{
int anwser = JOptionPane.showConfirmDialog(null, Config.QUESTION,"Confirm", JOptionPane.YES_NO_OPTION);
if(anwser == 1)
{
jList0.setSelectedIndex(incasationBegin);
return;
}
}
incasationBegin = jList0.getSelectedIndex();
어떻게 setSelectedIndex
jList0ListSelectionValueChanged
조치를 호출하지 않고 있습니까? 왜냐하면 옵션 확인 팝업을 클릭했을 때 아니오를 클릭하면 새 항목이 선택되기 때문입니다. 나는 회신하기 전에 incasationBegin =0;
을 추가하려고 시도했지만, 처음 클릭 확인 팝업에.자바 DefaultListModel
코드와 설명이 있더라도 여전히 따라 가지 않습니다. 정교하게 설명하거나 좀 더 명확하고 간결하게 설명해 주시겠습니까? – mre
'jList0.setSelectedIndex (incasationBegin);을 호출 한 후''jList0ListSelectionValueChanged' 액션이 호출되었고, 나는 이것을 원하지 않습니다. ?? –
선택/선택 취소가 완료 될 때마다 'valueChanged'가 트리거됩니다. 따라서 이것이 일어나기를 원하지 않는 것은 매우 부 자연스러운 것처럼 보입니다. 어쨌든, 브라우징 조금 내가 다음 링크를 착륙 - http://stackoverflow.com/questions/3092834/can-i-set-the-selected-item-for-a-jlist-without-having-an-event 던지다 – mre