本文整理了Java中javax.swing.JOptionPane.setValue()
方法的一些代码示例,展示了JOptionPane.setValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JOptionPane.setValue()
方法的具体详情如下:
包路径:javax.swing.JOptionPane
类名称:JOptionPane
方法名:setValue
暂无
代码示例来源:origin: stackoverflow.com
optionPane.setValue(btnString1);
optionPane.setValue(
JOptionPane.UNINITIALIZED_VALUE);
代码示例来源:origin: stackoverflow.com
final JButton okay = new JButton("Ok");
okay.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane pane = getOptionPane((JComponent)e.getSource());
// set the value of the option pane
pane.setValue(JOptionPane.OK_OPTION);
}
});
代码示例来源:origin: org.trypticon.hex/hex-util
@Override
public void actionPerformed(ActionEvent event) {
optionPane.setValue(1);
}
});
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
public void actionPerformed(ActionEvent e)
{
jOptionPane.setValue(buttonLabels[0]);
}
});
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
public void windowClosing(WindowEvent we) {
optionPane.setValue(JOptionPane.NO_OPTION);
}
});
代码示例来源:origin: Audiveris/audiveris
@Override
public void componentShown (ComponentEvent ce)
{
// reset value to ensure closing works properly
pane.setValue(JOptionPane.UNINITIALIZED_VALUE);
}
});
代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-runtime
public void componentShown(ComponentEvent ce) {
// reset value to ensure closing works properly
pane.setValue(JOptionPane.UNINITIALIZED_VALUE);
}
});
代码示例来源:origin: net.sf.jt400/jt400
public void windowClosing(WindowEvent we) {
//
// Instead of directly closing the window,
// we're going to change the JOptionPane's
// value property.
//
optionPane.setValue(new Integer(
JOptionPane.CLOSED_OPTION));
}
});
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
public void windowClosing(WindowEvent we)
{
jOptionPane.setValue(new Integer(JOptionPane.CLOSED_OPTION));
}
});
代码示例来源:origin: com.itextpdf/itext-rups
public void windowClosing(WindowEvent we) {
/*
* Instead of directly closing the window,
* we're going to change the JOptionPane's
* value property.
*/
optionPane.setValue(new Integer(
JOptionPane.CLOSED_OPTION));
}
});
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
public void windowClosing(WindowEvent we)
{
jOptionPane.setValue(new Integer(JOptionPane.CLOSED_OPTION));
}
});
代码示例来源:origin: jawi/ols
/**
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed( final ActionEvent aEvent )
{
final JOptionPane optionPane = ( JOptionPane )aEvent.getSource();
optionPane.setValue( Integer.valueOf( JOptionPane.CLOSED_OPTION ) );
}
}
代码示例来源:origin: es.gob.afirma/afirma-ui-core-jse-keystores
/** {@inheritDoc} */
@Override
public void mouseClicked(final MouseEvent me) {
if (me.getClickCount() == 2 && this.optionPane != null && !this.disableSelection) {
this.optionPane.setValue(Integer.valueOf(JOptionPane.OK_OPTION));
}
}
代码示例来源:origin: net.sf.taverna.t2.ui-activities/component-activity-ui
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane pane = getOptionPane((JComponent)e.getSource());
pane.setValue(JOptionPane.CANCEL_OPTION);
}
});
代码示例来源:origin: org.scijava/scijava-ui-swing
private void closeDialog(boolean okay) {
for (Container parent = getParent(); parent != null; parent = parent.getParent()) {
if (parent instanceof JOptionPane) {
((JOptionPane)parent).setValue(okay ? JOptionPane.OK_OPTION : JOptionPane.CANCEL_OPTION);
} else if (parent instanceof JDialog) {
((JDialog)parent).setVisible(false);
break;
}
}
}
代码示例来源:origin: stackoverflow.com
JOptionPane optionPane= new JOptionPane("message", JOptionPane.OK_CANCEL_OPTION);
final JDialog dialog = optionPane.createDialog(null, "Input");
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
dialog.addWindowListener(new WindowAdapter() {
@Override public void windowClosing(WindowEvent e) {
optionPane.setValue(JOptionPane.CANCEL_OPTION);
}
});
if (JOptionPane.CANCEL_OPTION!= ((Integer) optionPane.getValue()).intValue())
throw new myCancellationException();
代码示例来源:origin: freeplane/freeplane
@Override
public void actionPerformed(ActionEvent e) {
final Component source = (Component) e.getSource();
JOptionPane pane = (JOptionPane) SwingUtilities.getAncestorOfClass(JOptionPane.class, source);
pane.setValue(source);
}
}
代码示例来源:origin: igvteam/igv
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2) {
dialog.setVisible(false);
pane.setValue(JOptionPane.OK_OPTION);
dialog.dispose();
}
}
});
代码示例来源:origin: igniterealtime/Spark
public void propertyChange(PropertyChangeEvent e) {
String value = (String) pane.getValue();
if (Res.getString("close").equals(value)) {
pane.removePropertyChangeListener(this);
dlg.dispose();
} else if (Res.getString("close").equals(value)) {
pane.setValue(JOptionPane.UNINITIALIZED_VALUE);
}
}
};
代码示例来源:origin: net.sf.taverna.t2.ui-activities/component-activity-ui
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane pane = getOptionPane((JComponent)e.getSource());
pane.setValue(JOptionPane.OK_OPTION);
doOpen(panel.getChosenRegistry(), panel.getChosenFamily(),
panel.getChosenComponent(),
panel.getChosenComponentVersion());
}
});
内容来源于网络,如有侵权,请联系作者删除!