当前位置: 首页>>代码示例>>Java>>正文


Java ActionEvent类代码示例

本文整理汇总了Java中java.awt.event.ActionEvent的典型用法代码示例。如果您正苦于以下问题:Java ActionEvent类的具体用法?Java ActionEvent怎么用?Java ActionEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActionEvent类属于java.awt.event包,在下文中一共展示了ActionEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    if ("startButton".equals(e.getActionCommand())) {
        datasetIndex = datasetBox.getSelectedIndex();

        if (dataset[datasetIndex] == null) {
            DelimitedTextParser parser = new DelimitedTextParser();
            parser.setDelimiter("[\t]+");
            parser.setRowNames(true);
            parser.setColumnNames(true);
            if (datasetIndex == 2 || datasetIndex == 3) {
                parser.setRowNames(false);
            }

            try {
                dataset[datasetIndex] = parser.parse(datasetName[datasetIndex], smile.data.parser.IOUtils.getTestDataFile(datasource[datasetIndex]));
            } catch (Exception ex) {
                JOptionPane.showMessageDialog(null, "Failed to load dataset.", "ERROR", JOptionPane.ERROR_MESSAGE);
                System.err.println(ex);
            }
        }

        Thread thread = new Thread(this);
        thread.start();
    }
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:27,代码来源:SammonMappingDemo.java

示例2: loadPage

import java.awt.event.ActionEvent; //导入依赖的package包/类
public void loadPage(String url, final ActionListener listener)
        throws IOException {
    this.url = url;
    pane = new JEditorPane();
    pane.setContentType("text/html");
    pane.addPropertyChangeListener("page", new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            generate(0);
            if (listener != null)
                listener.actionPerformed(new ActionEvent(
                        HTMLPrintable.this, 0, "PageLoaded"));
        }
    });
    pane.setPage(url);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:18,代码来源:HTMLPrintable.java

示例3: actionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
@Override
public void actionPerformed (ActionEvent e) {
    if (e.getSource() == panel.btnRemove) {
        removeTag(getSelectedTag());
    } else if (e.getSource() == panel.btnUpdate) {
        dialog.setVisible(false);
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run () {
                SystemAction.get(UpdateAction.class).update(repository, getSelectedTag().getRevisionInfo());
            }
        });
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:TagManager.java

示例4: actionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
@Override
            public void actionPerformed(ActionEvent e) {
//                    System.out.println(e);
                try {
                    float x = Float.parseFloat(tfx.getText());
                    float y = Float.parseFloat(tfy.getText());
                    point.setLocation(x, y);
                    writeMethod.invoke(filter, point);
                    point = (Point2D.Float) readMethod.invoke(filter); // getString the value from the getter method to constrain it
                    set(point);
                } catch (NumberFormatException fe) {
                    tfx.selectAll();
                    tfy.selectAll();
                } catch (InvocationTargetException ite) {
                    ite.printStackTrace();
                } catch (IllegalAccessException iae) {
                    iae.printStackTrace();
                }
            }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:20,代码来源:ControlPanel.java

示例5: saveSimMenuActionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
private void saveSimMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveSimMenuActionPerformed
    String file = FileUtils.selectNonExistingFile(this, ".xml.gz");
    if ( file != null){
        try {
            simForm.guiToObj();
            simulation.labelNumberTransducers();
            simulation.setHoloMemory( holoPatternsForm.getHoloMemory() );
            
            simulation.getMaskObjects().clear();
            scene.gatherMeshEntitiesWithTag( simulation.getMaskObjects(), Entity.TAG_MASK);
            
            simulation.getSlices().clear();
            scene.gatherMeshEntitiesWithTag( simulation.getSlices(), Entity.TAG_SLICE);
            
            FileUtils.writeCompressedObject(new File(file), simulation);
        } catch (IOException ex) {
            Logger.getLogger(MainForm.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
 
开发者ID:asiermarzo,项目名称:Ultraino,代码行数:21,代码来源:MainForm.java

示例6: queryButtonActionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
private void queryButtonActionPerformed(ActionEvent e)
{
   // query that returns all contacts
   TypedQuery<Addresses> findByLastname = 
      entityManager.createNamedQuery(
         "Addresses.findByLastname", Addresses.class);

   // configure parameter for query
   findByLastname.setParameter("lastname", queryTextField.getText());
   results = findByLastname.getResultList(); // get all addresses
   numberOfEntries = results.size();
   
   if (numberOfEntries != 0)
   {
      currentEntryIndex = 0;
      displayRecord();
      nextButton.setEnabled(true);
      previousButton.setEnabled(true);
   } 
   else
      browseButtonActionPerformed(e);
}
 
开发者ID:cleitonferreira,项目名称:LivroJavaComoProgramar10Edicao,代码行数:23,代码来源:AddressBook.java

示例7: actionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    /* Button event listener */
    String command = e.getActionCommand();

    if (command.equals("Pass")) {
        /* Test has passed. Dispose the frame with success message */
        testComplete = true;
        testResult = true;
        System.out.println("Test Passed.");
    } else if (command.equals("Fail")) {
        /* Test has failed. Dispose the frame and throw exception */
        testComplete = true;
        testResult = false;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:VolatileImageConfigurationTest.java

示例8: butDeleteSpecScedActionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
private void butDeleteSpecScedActionPerformed(
    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butDeleteSpecScedActionPerformed
    if (listSpecSced.getSelectedIndex() != -1) {
        if (0 != JOptionPane
            .showConfirmDialog(this, "Do you really want remove the special schedule?",
                "Removing",
                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) {
            return;
        }
        QSpecSchedule sps = (QSpecSchedule) listSpecSced.getSelectedValue();
        if (sps != null) {
            final QCalendar item = (QCalendar) listCalendar.getSelectedValue();
            if (item == null) {
                return;
            }
            item.getSpecSchedules().remove(sps);
            listSpecSced.setModel(new DefaultComboBoxModel(item.getSpecSchedules().toArray()));
        }
    }
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:21,代码来源:FAdmin.java

示例9: addAllButtonActionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
private void addAllButtonActionPerformed(ActionEvent evt) {
    DataObject resource = selectResource();
    
    if (resource == null) {
        return;
    }

    // Feed data.
    for (int i = 0; i < resourcesTable.getRowCount(); i++) {
        DataObject dataObject = (DataObject) resourcesTable.getValueAt(i, 0);

        sourceMap.put(dataObject, new SourceData(resource));
        
        tableModel.fireTableCellUpdated(i, 1);
    }

    descPanel.fireStateChanged();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:ResourceWizardPanel.java

示例10: buttonAdvanceActionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
private void buttonAdvanceActionPerformed(
    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAdvanceActionPerformed
    setAdvanceRegim(!isAdvanceRegim());
    if (isMed && !isAdvanceRegim()) {
        showMed();
    }
    showButtons(root, panelMain);
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:9,代码来源:FWelcome.java

示例11: AttributeFileValueCellEditor

import java.awt.event.ActionEvent; //导入依赖的package包/类
public AttributeFileValueCellEditor(ParameterTypeAttributeFile type) {
	super(type);
	JButton button = new JButton(new ResourceAction(true, "edit_attributefile") {

		private static final long serialVersionUID = 1L;

		@Override
		public void actionPerformed(ActionEvent e) {
			buttonPressed();
		}
	});
	button.setMargin(new Insets(0, 0, 0, 0));
	button.setToolTipText("Edit or create attribute description files and data (XML).");
	addButton(button, GridBagConstraints.RELATIVE);

	addButton(createFileChooserButton(), GridBagConstraints.REMAINDER);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:18,代码来源:AttributeFileValueCellEditor.java

示例12: exportButtonActionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
private void exportButtonActionPerformed(java.awt.event.ActionEvent evt) {
	tikzExporter.setFixedSize(sizeFixedRButton.isSelected());
	
	if(sizeFixedRButton.isSelected()) {
		int width, height;
		width = Integer.parseInt(widthTextField.getText());
		height = Integer.parseInt(heightTextField.getText());
		tikzExporter.setSize(width, height);
		
	} else if(sizeScaledRButton.isSelected()) {
		double node, edge, coord;
		node = Double.parseDouble(nodeTextField.getText());
		edge = Double.parseDouble(edgeTextField.getText());
		coord = Double.parseDouble(coordTextField.getText());
		tikzExporter.setScalingFactors(node, edge, coord);
		
	} else if(sizeDefaultRButton.isSelected()) {
		// Select default scaling factors
		tikzExporter.setDefaultFactors();
		getScalingFactors();
		calculateHeightAndWidth();
		
	}
	
	if(style3DRButton.isSelected()) {
		tikzExporter.setNodeStyle("ball");
	} else {
		tikzExporter.setNodeStyle("circle");
	}
	
	tikzExporter.setOutputFile(new File(fileTextField.getText()));
	tikzExporter.exportToTikz(networkPanel.getNetworkLayout());
	this.setVisible(false);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:35,代码来源:TikzDialog.java

示例13: privateItemListener

import java.awt.event.ActionEvent; //导入依赖的package包/类
private ActionListener privateItemListener() {
	ActionListener listener = new ActionListener() {
		
		@Override
		public void actionPerformed(ActionEvent e) {
			final String roomNumber = roomNumCmbBox.getSelectedItem().toString();
			if(!roomNumber.isEmpty()) {
				Room theRoom = roomDaoImpl.getRoomByRoomNumber(roomNumber);
				roomTypeCmbBox.setSelectedItem(theRoom.getType());
				priceField.setValue(theRoom.getPrice());
				currencyCmbBox.setSelectedItem(theRoom.getCurrency());
			}
			repaint();
			
		}
	};
	return listener;
}
 
开发者ID:Coder-ACJHP,项目名称:Hotel-Properties-Management-System,代码行数:19,代码来源:NewReservationWindow.java

示例14: jAlignActionB_actionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
public void jAlignActionB_actionPerformed(ActionEvent e) {
	HTMLEditorKit.AlignmentAction aa =
		new HTMLEditorKit.AlignmentAction(
			"justifyAlign",
			StyleConstants.ALIGN_JUSTIFIED);
	aa.actionPerformed(e);
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:8,代码来源:HTMLEditor.java

示例15: buttonCustomJSMessageActionPerformed

import java.awt.event.ActionEvent; //导入依赖的package包/类
private void buttonCustomJSMessageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCustomJSMessageActionPerformed
    final JFXJavaScriptCallbacksPanel rc = new JFXJavaScriptCallbacksPanel(jfxProps);
    final DialogDescriptor dd = new DialogDescriptor(rc,
            NbBundle.getMessage(JFXDeploymentPanel.class, "TXT_JSCallbacks"), // NOI18N
            true,
            DialogDescriptor.OK_CANCEL_OPTION,
            DialogDescriptor.OK_OPTION,
            null);
    if (DialogDisplayer.getDefault().notify(dd) == DialogDescriptor.OK_OPTION) {
        jfxProps.setJSCallbacks(rc.getResources());
        jfxProps.setJSCallbacksChanged(true);
        refreshCustomJSLabel();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:JFXDeploymentPanel.java


注:本文中的java.awt.event.ActionEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。