當前位置: 首頁>>代碼示例>>Java>>正文


Java JComboBox.hidePopup方法代碼示例

本文整理匯總了Java中javax.swing.JComboBox.hidePopup方法的典型用法代碼示例。如果您正苦於以下問題:Java JComboBox.hidePopup方法的具體用法?Java JComboBox.hidePopup怎麽用?Java JComboBox.hidePopup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JComboBox的用法示例。


在下文中一共展示了JComboBox.hidePopup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: actionPerformed

import javax.swing.JComboBox; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent ae) {
    if (ConfigurationsManager.getDefault().size() == 1) {
        setSelectedItem(getElementAt(0));
        return;
    }
    JComboBox combo = (JComboBox) ae.getSource();
    combo.setSelectedItem(lastSelected);
    combo.hidePopup();
    if (JOptionPane.showConfirmDialog(combo, 
    Bundle.MSG_ReallyDeleteConfig(lastSelected),
    Bundle.DeleteConfigTitle(),
    JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
        ConfigurationsManager.getDefault().remove(lastSelected);
        setSelectedItem(getElementAt(0));
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:ConfigurationsComboModel.java

示例2: isMemorySelectionError

import javax.swing.JComboBox; //導入方法依賴的package包/類
/**
 * Checks if is memory selection error. The initial memory should 
 * always be larger than the maximum memory of the JVM.
 * @return true, if is memory selection error
 */
private boolean isMemorySelectionError(JComboBox<String> combo) {
	
	boolean error = false;
	String initialMemory = (String) getJComboBoxJVMMemoryInitial().getSelectedItem();
	String maximumMemory = (String) getJComboBoxJVMMemoryMaximum().getSelectedItem();
	int initMem = Integer.parseInt(initialMemory.replaceAll("[a-zA-Z]", ""));
	int maxiMem = Integer.parseInt(maximumMemory.replaceAll("[a-zA-Z]", ""));
	if(initialMemory.contains("g")){
		initMem = initMem*1024;
	}
	if(maximumMemory.contains("g")){
		maxiMem = maxiMem*1024;
	}
	
	if (initMem>=maxiMem) {
		combo.hidePopup();
		String head = Language.translate("Initialer Arbeitsspeicher >= Maximaler Arbeitsspeicher !");
		String msg = Language.translate("Der maximale Arbeitsspeicher muss größer als der initiale Arbeitsspeicher sein.");
		JOptionPane.showMessageDialog(Application.getMainWindow(), msg, head, JOptionPane.ERROR_MESSAGE);
		error = true;
	}
	return error;
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:29,代碼來源:Distribution.java


注:本文中的javax.swing.JComboBox.hidePopup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。