本文整理汇总了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);
}