本文整理匯總了Java中javax.swing.JList.isSelectionEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java JList.isSelectionEmpty方法的具體用法?Java JList.isSelectionEmpty怎麽用?Java JList.isSelectionEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JList
的用法示例。
在下文中一共展示了JList.isSelectionEmpty方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: valueChanged
import javax.swing.JList; //導入方法依賴的package包/類
public void valueChanged(ListSelectionEvent e) {
if(!e.getValueIsAdjusting()) {
JList source = (JList)e.getSource();
if(!source.isSelectionEmpty()) {
if(!this.otherList.isSelectionEmpty()) {
this.otherList.clearSelection();
}
PackageDescriptor desc = null;
Object selectedValue = source.getSelectedValue();
desc = (PackageDescriptor)selectedValue;
try {
ConfirmLicensesDialog.this.setLicensePaneContent(desc);
} catch (Exception var6) {
SwingTools.showSimpleErrorMessage("error_installing_update", var6, new Object[]{var6.getMessage()});
}
}
}
}
示例2: configure
import javax.swing.JList; //導入方法依賴的package包/類
/** Configures a list cell renderer and sets up sizing and the
* backing image from it */
public boolean configure (Object nd, JScrollPane tv, JList list, int row) {
boolean sameVn = setLastRendereredObject(nd);
boolean sameComp = setLastRenderedScrollPane (tv);
Component renderer = null;
bg = list.getBackground();
boolean sel = list.isSelectionEmpty() ? false :
list.getSelectionModel().isSelectedIndex(row);
renderer = list.getCellRenderer().getListCellRendererComponent(list, nd, row, sel, false);
if (renderer != null) {
setComponent (renderer, list);
}
return true;
}
示例3: removeSelected
import javax.swing.JList; //導入方法依賴的package包/類
private void removeSelected(JList list, String prefKey) {
DefaultListModel m = (DefaultListModel)list.getModel();
while (!list.isSelectionEmpty()) {
m.remove(list.getSelectionModel().getLeadSelectionIndex());
}
updatePreference(list, prefKey);
}
示例4: getSelectedValue
import javax.swing.JList; //導入方法依賴的package包/類
private Configurable getSelectedValue() {
if (!localConfigList.isSelectionEmpty()) {
return localConfigList.getSelectedValue();
} else {
for (JList<Configurable> list : remoteConfigLists.values()) {
if (!list.isSelectionEmpty()) {
return list.getSelectedValue();
}
}
}
return null;
}
示例5: valueChanged
import javax.swing.JList; //導入方法依賴的package包/類
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
JList<?> list = (JList<?>) e.getSource();
if (!list.isSelectionEmpty()) {
selectedRecord = (Record) list.getSelectedValue();
References.CHRONOMETER.setChronometerValue(String.format("%02d : %02d . %02d",
selectedRecord.getMinutes(), selectedRecord.getSeconds(), selectedRecord.getHundreths()));
} else {
References.CHRONOMETER.setChronometerValue("00 : 00 . 00");
}
}
}
示例6: valueChanged
import javax.swing.JList; //導入方法依賴的package包/類
@Override
public void valueChanged(ListSelectionEvent lse) {
JList lst = (JList)lse.getSource();
boolean sel = lst.isEnabled() && !lst.isSelectionEmpty();
btnRemoveGeneric.setEnabled(sel);
}