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