本文整理汇总了Java中org.jdesktop.swingx.JXTextField.setText方法的典型用法代码示例。如果您正苦于以下问题:Java JXTextField.setText方法的具体用法?Java JXTextField.setText怎么用?Java JXTextField.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.JXTextField
的用法示例。
在下文中一共展示了JXTextField.setText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addField
import org.jdesktop.swingx.JXTextField; //导入方法依赖的package包/类
private void addField(String name, ColumnType columnType) {
if (name == null) {
name = "";
}
final JXTextField nameTextField = WidgetFactory.createTextField();
nameTextField.setText(name);
if (columnType == null) {
columnType = ColumnType.VARCHAR;
}
final DCComboBox<ColumnType> typeComboBox = new DCComboBox<>(getAvailableColumnTypes());
typeComboBox.setRenderer(new EnumComboBoxListRenderer());
typeComboBox.setSelectedItem(columnType);
_tableModel.addRow(new Object[] { nameTextField, typeComboBox });
updateUI();
}
示例2: createTextField
import org.jdesktop.swingx.JXTextField; //导入方法依赖的package包/类
private JXTextField createTextField(final InputColumn<?> inputColumn, String mappedString) {
final JXTextField textField = WidgetFactory.createTextField();
_mappedTextFields.put(inputColumn, textField);
if (mappedString == null) {
mappedString = getDefaultMappedString(inputColumn);
}
if (mappedString != null) {
textField.setText(mappedString);
}
textField.getDocument().addDocumentListener(new DCDocumentListener() {
@Override
protected void onChange(final DocumentEvent event) {
if (isBatchUpdating()) {
return;
}
fireValueChanged();
_mappedStringsPropertyWidget.fireValueChanged();
}
});
return textField;
}
示例3: setMappedStrings
import org.jdesktop.swingx.JXTextField; //导入方法依赖的package包/类
public void setMappedStrings(final String[] value) {
final List<InputColumn<?>> inputColumns = MultipleMappedStringsPropertyWidget.this.getSelectedInputColumns();
for (int i = 0; i < inputColumns.size(); i++) {
final InputColumn<?> inputColumn = inputColumns.get(i);
final String mappedString;
if (value == null) {
mappedString = getDefaultMappedString(inputColumn);
} else if (i < value.length) {
mappedString = value[i];
} else {
mappedString = getDefaultMappedString(inputColumn);
}
final JXTextField textField = _mappedTextFields.get(inputColumn);
textField.setVisible(true);
final String previousText = textField.getText();
if (!mappedString.equals(previousText)) {
textField.setText(mappedString);
}
}
}
示例4: addTextField
import org.jdesktop.swingx.JXTextField; //导入方法依赖的package包/类
private void addTextField(final String value, final boolean updateUI) {
final JXTextField textField = WidgetFactory.createTextField();
if (value != null) {
textField.setText(value);
}
textField.getDocument().addDocumentListener(new DCDocumentListener() {
@Override
protected void onChange(final DocumentEvent e) {
fireValueChanged();
}
});
final int index = _textFieldPanel.getComponentCount();
final JComponent decoration = decorateTextField(textField, index);
_textFieldDecorations.put(decoration, textField);
_textFieldPanel.add(decoration);
if (updateUI) {
_textFieldPanel.updateUI();
}
}
示例5: addTextField
import org.jdesktop.swingx.JXTextField; //导入方法依赖的package包/类
private void addTextField(final Object value, final boolean updateUI) {
final JXTextField textField = WidgetFactory.createTextField();
if (value != null) {
textField.setText(_numberFormat.format(value));
}
textField.getDocument().addDocumentListener(new DCDocumentListener() {
@Override
protected void onChange(final DocumentEvent e) {
fireValueChanged();
}
});
_textFieldPanel.add(textField);
if (updateUI) {
_textFieldPanel.updateUI();
}
}
示例6: limparCampos
import org.jdesktop.swingx.JXTextField; //导入方法依赖的package包/类
/**
* Metodo usado para limpar os campos
*/
private void limparCampos() {
if(!mexido){
this.limparOsPrimeirosCampos();
return;
}
for(Object ob : componentes){
JXTextField tf = (JXTextField) ob;
tf.setText(null);
}
}
示例7: createVariableTextFields
import org.jdesktop.swingx.JXTextField; //导入方法依赖的package包/类
private Map<String, JXTextField> createVariableTextFields() {
final Map<String, JXTextField> variableTextFields = new HashMap<>();
for (final Entry<String, String> variableEntry : _metadata.getVariables().entrySet()) {
final String id = variableEntry.getKey();
final String value = variableEntry.getValue();
final JXTextField textField = WidgetFactory.createTextField("Original: " + value);
textField.setText(value);
variableTextFields.put(id, textField);
}
return variableTextFields;
}
示例8: updateComponents
import org.jdesktop.swingx.JXTextField; //导入方法依赖的package包/类
public void updateComponents(String[] values) {
if (values == null) {
values = new String[2];
}
final String[] previousValues = getValue();
if (!EqualsBuilder.equals(values, previousValues)) {
for (int i = 0; i < Math.min(previousValues.length, values.length); i++) {
// modify text boxes
if (!EqualsBuilder.equals(previousValues[i], values[i])) {
final Component decoration = _textFieldPanel.getComponent(i);
final JXTextField component = _textFieldDecorations.get(decoration);
component.setText(values[i]);
}
}
while (_textFieldPanel.getComponentCount() < values.length) {
// add text boxes if there are too few
final String nextValue = values[_textFieldPanel.getComponentCount()];
addTextField(nextValue, false);
}
while (_textFieldPanel.getComponentCount() > values.length) {
removeTextField();
}
_textFieldPanel.updateUI();
}
}