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


Java ItemEvent.getItem方法代碼示例

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


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

示例1: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
@Override
public void itemStateChanged(ItemEvent e) {
	if (e.getItem() == mouseToolbarCheckbox) {
		toolbars.getMouseToolbar().setVisible(mouseToolbarCheckbox.getState() );			
	} else if (e.getItem() == zoomToolbarCheckbox) {
		toolbars.getZoomToolbar().setVisible(zoomToolbarCheckbox.getState() );
	} else if (e.getItem() == simulationToolbarCheckbox) {
		toolbars.getSimulationToolbar().setVisible(simulationToolbarCheckbox.getState() );
	} else if (e.getItem() == dbToolbarCheckbox) {
		toolbars.getDBToolbar().setVisible(dbToolbarCheckbox.getState() );
	} else if (e.getItem() == undoToolbarCheckbox) {
		toolbars.getUndoToolbar().setVisible(undoToolbarCheckbox.getState());
	} else {
		System.err.println("Unknown event");
	}
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:17,代碼來源:ViewMenu.java

示例2: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
@Override
public void itemStateChanged(ItemEvent e) {
	if (e.getItem() == mouseToolbarCheckbox) {
		toolbars.getMouseToolbar().setVisible(
				mouseToolbarCheckbox.getState());
	} else if (e.getItem() == zoomToolbarCheckbox) {
		toolbars.getZoomToolbar()
				.setVisible(zoomToolbarCheckbox.getState());
	} else if (e.getItem() == simulationToolbarCheckbox) {
		toolbars.getSimulationToolbar().setVisible(
				simulationToolbarCheckbox.getState());
	} else if (e.getItem() == dbToolbarCheckbox) {
		toolbars.getDBToolbar().setVisible(dbToolbarCheckbox.getState());
	} else if (e.getItem() == undoToolbarCheckbox) {
		toolbars.getUndoToolbar()
				.setVisible(undoToolbarCheckbox.getState());
	} else {
		Cuttlefish.err("Unknown event");
	}
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:21,代碼來源:ViewMenu.java

示例3: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
@Override
public void itemStateChanged(ItemEvent evt) {
    if(evt.getStateChange() == ItemEvent.SELECTED) {
        RepositoryConnection rc = (RepositoryConnection) evt.getItem();
        if (rc != null) {
            currentPanel.refresh(rc);
            updateVisibility();  
            editedRC = new RepositoryConnection(rc);
        }
    } else if(evt.getStateChange() == ItemEvent.DESELECTED) {
        updateVisibility();  
    }       
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:Repository.java

示例4: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
@Override
public void itemStateChanged(ItemEvent e) {
    if(e.getItem() instanceof CompletionPopup.OptionCheckbox) {
        CompletionPopup.OptionCheckbox checkbox = (CompletionPopup.OptionCheckbox) e.getItem();
        InstantOption option = checkbox.option;
        boolean oldValue = option.selected();
        boolean newValue = checkbox.isSelected();
        option.setSelected(newValue);
        listener.propertyChange(new PropertyChangeEvent(option, option.displayName(), oldValue, newValue));
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:CompletionLayout.java

示例5: runSetJarArtifact

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
private void runSetJarArtifact(ConnectorPresenter presenter, ItemEvent e) {
    if(e.getStateChange() != ItemEvent.SELECTED)
        return;
    ArtifactEntry entry = (ArtifactEntry) e.getItem();
    if(entry == null)
        return;
    runOperation(() -> presenter.setJarArtifact(entry), "Select JAR-artifact: " + entry.toString());
}
 
開發者ID:satr,項目名稱:intellij-idea-plugin-connector-for-aws-lambda,代碼行數:9,代碼來源:ConnectorViewFactory.java

示例6: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
@Override
public void itemStateChanged(ItemEvent e) {
    if (repositoryComboBox.isEnabled()) {
        enableFields();
    }
    if(e.getStateChange() == ItemEvent.SELECTED) {
        Object item = e.getItem();
        if(item instanceof Repository) {
            Repository repo = (Repository) item;
            qs.setRepository(repo);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:QuickSearchPanel.java

示例7: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
public void itemStateChanged(ItemEvent e) {

        String s = (String) e.getItem();

        for (int i = 0; i < connTypes.length; i++) {
            if (s.equals(connTypes[i][0])) {
                mDriver.setText(connTypes[i][1]);
                mURL.setText(connTypes[i][2]);
            }
        }
    }
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:12,代碼來源:ConnectionDialogSwing.java

示例8: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
public void itemStateChanged(ItemEvent e) 
{
	if ( e.getStateChange() == ItemEvent.SELECTED )
	{
		MonthInfo v_NewMonth = ((MonthInfo)e.getItem());
		
		if ( isAllowEvent )
		{
			setMonth(v_NewMonth.getMonth());
		}
	}
}
 
開發者ID:HY-ZhengWei,項目名稱:hy.common.ui,代碼行數:13,代碼來源:JDatePanel.java

示例9: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    String s = (String) e.getItem();

    for (int i = 0; i < sJDBCTypes.length; i++) {
        if (s.equals(sJDBCTypes[i][0])) {
            mDriver.setText(sJDBCTypes[i][1]);
            mURL.setText(sJDBCTypes[i][2]);
        }
    }
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:18,代碼來源:ZaurusConnectionDialog.java

示例10: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
@Override
public void itemStateChanged(ItemEvent event) {
    if (event.getStateChange() == ItemEvent.SELECTED) {
        ComboModel item = (ComboModel) event.getItem();
        foodIds.add(item.getId());
    }
}
 
開發者ID:seyidkanan,項目名稱:my-diploma-work,代碼行數:8,代碼來源:KnowledgeBaseFrame.java

示例11: itemStateChanged

import java.awt.event.ItemEvent; //導入方法依賴的package包/類
@Override
public void itemStateChanged(ItemEvent e) {
    if (e.getSource() instanceof Checkbox) {
        target.setForeground(((Component) e.getSource()).getForeground());
    } else if (e.getSource() instanceof Choice) {
        String choice = (String) e.getItem();
        if (choice.equals("Lines")) {
            target.setDrawMode(DrawPanel.LINES);
        } else if (choice.equals("Points")) {
            target.setDrawMode(DrawPanel.POINTS);
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:14,代碼來源:DrawTest.java


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