本文整理匯總了Java中javax.swing.JFormattedTextField.addPropertyChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java JFormattedTextField.addPropertyChangeListener方法的具體用法?Java JFormattedTextField.addPropertyChangeListener怎麽用?Java JFormattedTextField.addPropertyChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JFormattedTextField
的用法示例。
在下文中一共展示了JFormattedTextField.addPropertyChangeListener方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupPosBox
import javax.swing.JFormattedTextField; //導入方法依賴的package包/類
private JPanel setupPosBox(String coord, JFormattedTextField field)
{
JPanel posPanel = new JPanel();
JLabel label = new JLabel(coord);
posPanel.add(label);
posPanel.add(field);
field.addPropertyChangeListener("value", new PropertyChangeListener()
{
@Override
public void propertyChange(PropertyChangeEvent evt)
{
update();
}
});
return posPanel;
}
示例2: setupSwivelParam
import javax.swing.JFormattedTextField; //導入方法依賴的package包/類
private JPanel setupSwivelParam(String id, JFormattedTextField field)
{
JPanel posPanel = new JPanel();
JLabel label = new JLabel(id);
posPanel.add(label);
posPanel.add(field);
field.addPropertyChangeListener("value", new PropertyChangeListener()
{
@Override
public void propertyChange(PropertyChangeEvent evt)
{
update();
}
});
return posPanel;
}
示例3: SoftSphereSolidEOSCalculator
import javax.swing.JFormattedTextField; //導入方法依賴的package包/類
public SoftSphereSolidEOSCalculator() {
super(new BorderLayout());
double density = 1.1964;
double temperature = 1.0;
double[] quantity = getAllQuantity(FCC, n, temperature, density);
//Create the labels.
densityLabel = new JLabel(densityString);
temperatureLabel = new JLabel(temperatureString);
bALabel = new JLabel(bAString);
ZLabel = new JLabel(ZString);
bULabel = new JLabel(bUString);
//Create the text fields and set them up.
densityField = new JFormattedTextField(densityFormat);
densityField.setValue(new Double(density));
densityField.setColumns(10);
densityField.addPropertyChangeListener("value", this);
temperatureField = new JFormattedTextField(temperatureFormat);
temperatureField.setValue(new Double(temperature));
temperatureField.setColumns(10);
temperatureField.addPropertyChangeListener("value", this);
bAField = new JFormattedTextField(bAFormat);
bAField.setValue(new Double(quantity[0]));
bAField.setColumns(10);
bAField.setEditable(false);
// paymentField.setForeground(Color.red);
ZField = new JFormattedTextField(ZFormat);
ZField.setValue(new Double(quantity[1]));
ZField.setColumns(10);
ZField.setEditable(false);
bUField = new JFormattedTextField(bUFormat);
bUField.setValue(new Double(quantity[2]));
bUField.setColumns(10);
bUField.setEditable(false);
//Tell accessibility tools about label/textfield pairs.
densityLabel.setLabelFor(densityField);
temperatureLabel.setLabelFor(temperatureField);
bALabel.setLabelFor(bAField);
ZLabel.setLabelFor(ZField);
bULabel.setLabelFor(bUField);
//Lay out the labels in a panel.
JPanel labelPane = new JPanel(new GridLayout(0,1));
labelPane.add(densityLabel);
labelPane.add(temperatureLabel);
labelPane.add(bALabel);
labelPane.add(ZLabel);
labelPane.add(bULabel);
//Layout the text fields in a panel.
JPanel fieldPane = new JPanel(new GridLayout(0,1));
fieldPane.add(densityField);
fieldPane.add(temperatureField);
fieldPane.add(bAField);
fieldPane.add(ZField);
fieldPane.add(bUField);
//Put the panels in this panel, labels on left,
//text fields on right.
setBorder(BorderFactory.createEmptyBorder(40, 40, 40, 40));
add(labelPane, BorderLayout.CENTER);
add(fieldPane, BorderLayout.LINE_END);
// LayoutStyle layout = new
}