本文整理汇总了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
}