本文整理汇总了Java中java.awt.event.ItemEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java ItemEvent.getSource方法的具体用法?Java ItemEvent.getSource怎么用?Java ItemEvent.getSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.ItemEvent
的用法示例。
在下文中一共展示了ItemEvent.getSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent event) {
if ( event.getSource() == jComboBoxMtpProtocol){
if (this.getJcomboBoxMtpProtocol().getSelectedProtocol()==MtpProtocol.HTTP) {
// ---- switch to HTTP ----------------------------------
this.setHttpsComponentsEnabledState(false);
this.currProject.getJadeConfiguration().setMtpProtocol(MtpProtocol.HTTP);
this.getJTextFieldKeyStoreFile().setText(null);
this.getJTextFieldTrustStoreFile().setText(null);
} else if (this.getJcomboBoxMtpProtocol().getSelectedProtocol()==MtpProtocol.HTTPS) {
// ---- switch to HTTPS ------------------------------
this.setHttpsComponentsEnabledState(true);
this.editHTTPSsettings(event.getSource(), MtpProtocol.HTTPS);
} else if(this.getJcomboBoxMtpProtocol().getSelectedProtocol()==MtpProtocol.PROXIEDHTTPS){
this.setHttpsComponentsEnabledState(true);
this.editHTTPSsettings(event.getSource(), MtpProtocol.PROXIEDHTTPS);
}
}
}
示例2: handleRadioButtonItemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
protected void handleRadioButtonItemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.SELECTED) {
RadioButton button = (RadioButton) e.getSource();
System.out.println(button.getActionCommand().split("/")[0]);
this.inputExtension = button.getActionCommand().split("/")[0];
textField.setToOriginalText();
textOutputDir.setToOriginalText();
btnConvert.setEnabled(false);
String buttonName = button.getName();
if(buttonName.equals("SVY")||buttonName.equals("XYZ")||buttonName.equals("LAZ")||buttonName.equals("PTX")) {
exportDxfColorCheckBox.setSelected(false);
exportDxfColorCheckBox.setEnabled(false);
} else if(buttonName.equals("PTS")) {
exportDxfColorCheckBox.setEnabled(true);
}
}
}
示例3: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged( ItemEvent e ) {
Object source = e.getSource();
if ( source instanceof JCheckBoxMenuItem ) {
JCheckBoxMenuItem cbmi = (JCheckBoxMenuItem) source;
if ( cbmi == displayGridCBMI )
fp.setGridDisplay( displayGridCBMI.getState() );
else if ( cbmi == force16ColsCBMI )
fp.setForce16Columns( force16ColsCBMI.getState() );
else if ( cbmi == showFontInfoCBMI ) {
if ( showFontInfoCBMI.getState() ) {
fireUpdateFontInfo();
fontInfoDialog.show();
}
else
fontInfoDialog.hide();
}
}
}
示例4: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
Object source = e.getSource();
if (source==projectBox) {
populateTagComboBox((Project)projectBox.getSelectedItem());
} else if (source==tagSelectBox) {
changeEditTagTxtField((String)tagSelectBox.getSelectedItem());
}
}
示例5: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e){
if(e.getSource() == comboBoxLeague){
for(int i = 0; i < comboBoxContent.length; i++){
if(e.getSource() == comboBoxLeague){
if(comboBoxLeague.getSelectedItem().equals(comboBoxContent[i])){
selectedLeagueID = leagueID[i];
prefs.put("LeagueNameListIndex", Integer.toString(i));
loadPreferences();
updateDates();
updateStartButton();
break;
}
}
}
}
else if(e.getSource() == comboBoxMode){
if(comboBoxMode.getSelectedItem().equals("CSV")){
prefs.put("LadderTrackerMode", Integer.toString(0));
}
else{
prefs.put("LadderTrackerMode", Integer.toString(1));
}
loadPreferences();
}
}
示例6: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent event) {
if ( event.getSource() == this.getJComboBoxMtpProtocol()){
MtpProtocol currentMTP = this.getJComboBoxMtpProtocol().getSelectedProtocol();
this.action = "COMBO";
if (currentMTP == MtpProtocol.HTTP) {
// ---- switch from HTTPS to HTTP ----------------------------------
this.hideCertificateSettings();
} else if (currentMTP == MtpProtocol.HTTPS) {
// ---- switch between HTTP and HTTPS ------------------------------
if (event.getStateChange() == ItemEvent.SELECTED) {
Object item = event.getItem();
if (item.equals(MtpProtocol.HTTPS)) {
// ---- If the user choose HTTPS ---------------------------
this.showCertificateSettings();
// --- If the stores are not defined or do not exist, open the configuration dialog ----------
if(this.keyStore == null || this.trustStore == null || this.keyStore.exists() == false || this.trustStore.exists() == false){
this.editHTTPSsettings();
}
} else {
// ---- If the user choose HTTP ----------------------------
this.hideCertificateSettings();
}
}
} else if (currentMTP == MtpProtocol.PROXIEDHTTPS){
System.err.println("NOT YET IMPLEMENTED");
}
}
}
示例7: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged (ItemEvent evt){
if(evt.getSource()== jRadioButtonPaciente){
jLabel4.setVisible(false);
CRM.setVisible(false);
LabelFarmacia.setVisible(false);
NomeFarmacia.setVisible(false);
vlogin.type = 0;
}else if(evt.getSource()== jRadioButtonMedico){
jLabel4.setVisible(true);
CRM.setVisible(true);
LabelFarmacia.setVisible(false);
NomeFarmacia.setVisible(false);
vlogin.type = 1;
}else if(evt.getSource() == jRadioButtonFarmaceutico){
jLabel4.setVisible(false);
CRM.setVisible(false);
LabelFarmacia.setVisible(true);
NomeFarmacia.setVisible(true);
vlogin.type = 2;
}
}
示例8: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e) {
for (int i = 0; i < columns.length; i++) {
if (komponente[i] == e.getSource()) {
komponente[i].setChanged();
break;
}
}
}
示例9: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Item event detected.\n"
+ " Event source: " + source.getText()
+ " (an instance of " + source.getClass().getName() + ")\n"
+ " New state: "
+ ((e.getStateChange() == ItemEvent.SELECTED) ?
"selected":"unselected") + "\n\n";
System.err.println(s);
}
示例10: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e)
{
if (e.getSource() == shapeChoices) // choosing a shape
drawPanel.setShapeType(shapeChoices.getSelectedIndex());
else if (e.getSource() == colorChoices) // choosing a color
drawPanel.setDrawingColor(
colors[colorChoices.getSelectedIndex()]);
else if (e.getSource() == filledCheckBox) // filled/unfilled
drawPanel.setFilledShape(filledCheckBox.isSelected());
}
示例11: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Item event detected."
+ newline
+ " Event source: " + source.getText()
+ " (an instance of " + getClassName(source) + ")"
+ newline
+ " New state: "
+ ((e.getStateChange() == ItemEvent.SELECTED) ?
"selected":"unselected");
output.append(s + newline);
output.setCaretPosition(output.getDocument().getLength());
}
示例12: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e) {
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Item event detected.\n"
+ " Event source: " + source.getText()
+ " (an instance of " + source.getClass().getName() + ")\n"
+ " New state: "
+ ((e.getStateChange() == ItemEvent.SELECTED) ?
"selected":"unselected") + "\n\n";
System.err.println(s);
}
示例13: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent evt) {
if (evt.getStateChange() == ItemEvent.SELECTED) {
if (evt.getSource() == onlyDoublyConnectedCB) {
onlySinglyConnectedCB.setState(false);
}
else {
onlyDoublyConnectedCB.setState(false);
}
}
}
示例14: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if(e.getSource() == panel.filterComboBox) {
onFilterChange((Filter)e.getItem());
}
}
示例15: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if(e.getSource() == comboCountry) comboCountry_Change(e);
}