• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JXTextField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jdesktop.swingx.JXTextField的典型用法代码示例。如果您正苦于以下问题:Java JXTextField类的具体用法?Java JXTextField怎么用?Java JXTextField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JXTextField类属于org.jdesktop.swingx包,在下文中一共展示了JXTextField类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: pegarValuesDoArray

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
/**
 * Metodo usado para pegar os valores do arrayPreenchidoo apos adicionar ou
 * remover variavel
 */
private void pegarValuesDoArray() {
    cadaLinha = new ArrayList<>();
    matriz = new ArrayList<>();
    mapaDeResultados = new HashMap();
    int cont = 0;
    
    for (int i = 0; i < this.numeroDeVar; i++) {
        for (int j = 0; j <= this.numeroDeVar; j++) {
            JXTextField t = (JXTextField) componentes.get(cont);
            cadaLinha.add(Double.parseDouble(t.getText()));
            cont++;
        }
        cadaLinha.add(0.0);
        cadaLinha.add(0.0);
        cadaLinha.add(0.0);
        this.matriz.add(cadaLinha);
        cadaLinha = new ArrayList<>();
        
    }
    this.mapaDeResultados = this.controle.receberMatriz(matriz, tfNrDeCasas.getText());
    lbResultado.setText(this.mapaDeResultados.toString());
    this.controle.imprimirNaTA(jTextArea1);
    
}
 
开发者ID:AlfredoSebastiao,项目名称:Metodo-de-Gaus-Com-Pivot,代码行数:29,代码来源:Tela.java


示例2: main

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
public static void main(String[] args) {
    SwingUtilities.invokeLater(() -> {
        JXFrame jxFrame = new JXFrame("Test JXFrame", true);
        jxFrame.setPreferredSize(new Dimension(300, 200));
        jxFrame.setStartPosition(JXFrame.StartPosition.CenterInScreen);
        JXBusyLabel label = new JXBusyLabel();
        label.setBusy(true);
        JXTextField textField = new JXTextField("<html><h1>test prompt</html>");
        textField.addBuddy(new JXButton("buddy"), BuddySupport.Position.LEFT);
        final JXPanel jPanel = new JXPanel(new BorderLayout());
        jPanel.add(label, BorderLayout.NORTH);
        jPanel.add(textField, BorderLayout.CENTER);
        jxFrame.getRootPaneExt().setContentPane(jPanel);
        jxFrame.pack();
        jxFrame.setVisible(true);
    });
}
 
开发者ID:toyboxman,项目名称:yummy-xml-UI,代码行数:18,代码来源:TestJxframe.java


示例3: getNewColumnNames

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
private List<String> getNewColumnNames() {
    final List<String> newColumnNames = new LinkedList<>();
    final List<JXTextField> values = new ArrayList<>(_columnNamesTextFields.values());
    for (int i = 0; i < values.size(); i++) {
        final JXTextField jxTextField = values.get(i);
        final String text;
        final String valueTextBox = jxTextField.getText().trim();
        if (StringUtils.isNullOrEmpty(valueTextBox)) {
            text = jxTextField.getPrompt();
        } else {
            text = valueTextBox;
        }
        newColumnNames.add(text);
    }
    return newColumnNames;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:17,代码来源:ColumnNamesSetterDialog.java


示例4: addJobLevelVariables

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
private void addJobLevelVariables() {
    final JLabel tableLabel = DCLabel.bright("<html><b>Job-level variables</b></html>");
    tableLabel.setIcon(imageManager.getImageIcon(IconUtils.MODEL_JOB, IconUtils.ICON_SIZE_SMALL));
    WidgetUtils.addToGridBag(tableLabel, _panel, 0, _row, 2, 1, GridBagConstraints.WEST);

    for (final Entry<String, JXTextField> entry : _variableTextFields.entrySet()) {
        _row++;
        final String variableId = entry.getKey();
        final JXTextField textField = entry.getValue();

        WidgetUtils.addToGridBag(
                new JLabel(imageManager.getImageIcon("images/model/variable.png", IconUtils.ICON_SIZE_SMALL)),
                _panel, 0, _row);
        WidgetUtils.addToGridBag(DCLabel.bright(variableId), _panel, 1, _row, GridBagConstraints.WEST);
        WidgetUtils.addToGridBag(textField, _panel, 2, _row, GridBagConstraints.WEST);
    }

    _row++;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:20,代码来源:OpenAnalysisJobAsTemplateDialog.java


示例5: 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();
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:18,代码来源:SimpleTableDefPanel.java


示例6: 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;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:23,代码来源:MultipleMappedStringsPropertyWidget.java


示例7: 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);
        }
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:23,代码来源:MultipleMappedStringsPropertyWidget.java


示例8: 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();
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:22,代码来源:MultipleStringPropertyWidget.java


示例9: 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();
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:17,代码来源:AbstractMultipleNumberPropertyWidget.java


示例10: getCellEditor

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
@Override
public TableCellEditor getCellEditor(int row, int column, 
		String columnName, TableModel tableModel, JTable table) {
	if ( "value".equals(columnName) || "default".equals(columnName) ) {
		int modelColIndex = table.convertColumnIndexToModel(column);
		int modelRowIndex = table.convertRowIndexToModel(row);
		Object value =  this.tableModel.getValueAt(modelRowIndex, modelColIndex);
		if ( value instanceof BasicDBList ) {
			MongoDBArrayEditor editor =  new MongoDBArrayEditor();
			editor.setDBObject((BasicDBList)value);
			return editor;
		} else {
			JXTextField field = new JXTextField(value.toString());
			field.setPreferredSize(new Dimension(100, 36));
			field.setBorder(null);
			return new DefaultCellEditor(field);
		}
	}
	return null;
}
 
开发者ID:wangqi,项目名称:gameserver,代码行数:21,代码来源:GamedataEditorRenderFactory.java


示例11: gerarCamposNoInicio

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
private void gerarCamposNoInicio() {
    /**
     * Removendo todos componentes do painel da matriz
     */
    pnMatriz.removeAll();
    componentes = new ArrayList();
    
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j <= 2 + 1; j++) {
            if (j == 2) {
                JLabel lb = new JLabel("=");
                lb.setHorizontalAlignment(JLabel.CENTER);
                pnMatriz.add(lb);
            } else {
                JXTextField tf = new JXTextField();
                tf.setHorizontalAlignment(JXTextField.CENTER);
                tf.setSize(50, 50);
                if (j == 3) {
                    
                    tf.setPrompt("b" + (i + 1));
                    
                } else {
                    
                    tf.setPrompt("X" + (i + 1) + (j + 1));
                    
                }
                componentes.add(tf);
                pnMatriz.add(tf);
            }
        }
    }
}
 
开发者ID:AlfredoSebastiao,项目名称:Metodo-de-Gaus-Com-Pivot,代码行数:33,代码来源:Tela.java


示例12: 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);
    }
}
 
开发者ID:AlfredoSebastiao,项目名称:Metodo-de-Gaus-Com-Pivot,代码行数:15,代码来源:Tela.java


示例13: createTextField

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
public static JXTextField createTextField(final String promptText, final int columns) {
    final JXTextField tf = new JXTextField(promptText);
    tf.setColumns(columns);
    if (promptText != null) {
        tf.setFocusBehavior(FocusBehavior.SHOW_PROMPT);
        tf.setToolTipText(promptText);
    }
    return tf;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:10,代码来源:WidgetFactory.java


示例14: 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;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:14,代码来源:OpenAnalysisJobAsTemplateDialog.java


示例15: createOpenButton

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
private JButton createOpenButton() {
    final JButton openButton = WidgetFactory.createPrimaryButton("Open job", IconUtils.MODEL_JOB);
    openButton.addActionListener(event -> {
        final JaxbJobReader reader = new JaxbJobReader(_configuration);

        try {
            final SourceColumnMapping sourceColumnMapping = getSourceColumnMapping();
            final Map<String, String> variableOverrides = new HashMap<>();

            for (final Entry<String, JXTextField> entry : _variableTextFields.entrySet()) {
                variableOverrides.put(entry.getKey(), entry.getValue().getText());
            }

            final InputStream inputStream = _file.getContent().getInputStream();
            final AnalysisJobBuilder analysisJobBuilder;

            try {
                analysisJobBuilder = reader.create(inputStream, sourceColumnMapping, variableOverrides);
            } finally {
                FileHelper.safeClose(inputStream);
            }

            final OpenAnalysisJobActionListener openAnalysisJobActionListener =
                    _openAnalysisJobActionListenerProvider.get();
            final Injector injector = openAnalysisJobActionListener.openAnalysisJob(_file, analysisJobBuilder);
            OpenAnalysisJobAsTemplateDialog.this.dispose();
            final AnalysisJobBuilderWindow window = injector.getInstance(AnalysisJobBuilderWindow.class);
            window.open();
        } catch (final Exception e) {
            throw new IllegalStateException(e);
        }
    });

    return openButton;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:36,代码来源:OpenAnalysisJobAsTemplateDialog.java


示例16: getDialogContent

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
@Override
protected JComponent getDialogContent() {
    final DCLabel label = DCLabel.darkMultiLine(
            "Warning! You are about to <b>drop</b> (delete) the table with " + "name '<b>" + _table.getName()
                    + "</b>'. This operation cannot be undone.<br/><br/>As a precaution "
                    + "to avoid unintended loss of data, please enter the name of the table below and click the "
                    + "'Drop table' button to confirm the operation.");
    final JXTextField confirmTextField = WidgetFactory.createTextField("Enter the table's name to confirm");

    final JButton dropTableButton = WidgetFactory.createPrimaryButton("Drop table", IconUtils.ACTION_DROP_TABLE);
    dropTableButton.addActionListener(e -> {
        if (!confirmTextField.getText().trim().equalsIgnoreCase(_table.getName().trim())) {
            WidgetUtils.showErrorMessage("Enter the table's name to confirm",
                    "The names do not match. Please enter '" + _table.getName()
                            + "' if you wish to drop the table.");
            return;
        }
        doDropTable();
        _schemaTree.refreshDatastore();
        DropTableDialog.this.close();
    });

    final JButton cancelButton = WidgetFactory.createDefaultButton("Cancel", IconUtils.ACTION_CANCEL);
    cancelButton.addActionListener(e -> DropTableDialog.this.close());

    final DCPanel panel = new DCPanel(WidgetUtils.COLOR_WELL_BACKGROUND);
    int row = 0;
    WidgetUtils.addToGridBag(label, panel, 0, row, 2, 1, GridBagConstraints.CENTER, 4, 1.0, 1.0);
    row++;
    WidgetUtils.addToGridBag(confirmTextField, panel, 0, row, 2, 1);
    row++;
    WidgetUtils.addToGridBag(dropTableButton, panel, 0, row, 0.5, 0.1);
    WidgetUtils.addToGridBag(cancelButton, panel, 1, row, 0.5, 0.1);

    panel.setPreferredSize(getDialogWidth(), 300);

    return panel;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:39,代码来源:DropTableDialog.java


示例17: getTableDef

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
public SimpleTableDef getTableDef() {
    final int rowCount = _tableModel.getRowCount();
    final String[] names = new String[rowCount];
    final ColumnType[] types = new ColumnType[rowCount];
    for (int i = 0; i < types.length; i++) {
        final JXTextField nameTextField = (JXTextField) _tableModel.getValueAt(i, 0);
        names[i] = nameTextField.getText();

        @SuppressWarnings("unchecked") final DCComboBox<ColumnType> typeComboBox =
                (DCComboBox<ColumnType>) _tableModel.getValueAt(i, 1);
        types[i] = typeComboBox.getSelectedItem();
    }
    return new SimpleTableDef(_tableName, names, types);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:15,代码来源:SimpleTableDefPanel.java


示例18: decorateTextField

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
@Override
protected JComponent decorateTextField(final JXTextField textField, final int index) {
    final DCComboBox<Class<?>> comboBox;

    if (index < _comboBoxes.size()) {
        comboBox = _comboBoxes.get(index);
    } else {
        comboBox = createComboBox(null);
    }

    comboBox.addListener(item -> _typesPropertyWidget.fireValueChanged());

    textField.getDocument().addDocumentListener(new DCDocumentListener() {
        @Override
        protected void onChange(final DocumentEvent event) {
            // invoke later, because document events are fired before the
            // textfield.getText() returns the new value
            SwingUtilities.invokeLater(() -> {
                setUpdating(true);
                _typesPropertyWidget.fireValueChanged();
                setUpdating(false);
            });
        }
    });

    final DCPanel panel = new DCPanel();
    panel.setLayout(new BorderLayout());
    panel.add(textField, BorderLayout.CENTER);
    panel.add(comboBox, BorderLayout.EAST);

    return panel;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:33,代码来源:KeysAndTypesPropertyWidget.java


示例19: updateTextFieldsAfterRadioButtonChange

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
protected void updateTextFieldsAfterRadioButtonChange() {
    final JXTextField sidTextField = getParam1TextField();
    final JXTextField databaseTextField = getDatabaseTextField();

    final boolean sidMode = _radioSid.isSelected();
    sidTextField.setEnabled(sidMode);
    databaseTextField.setEnabled(!sidMode);

    sidTextField.setPrompt(sidMode ? getLabelForParam1() : "");
    databaseTextField.setPrompt(sidMode ? "" : getLabelForDatabase());
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:12,代码来源:OracleDatabaseConnectionPresenter.java


示例20: getValue

import org.jdesktop.swingx.JXTextField; //导入依赖的package包/类
@Override
public InputColumn<?>[] getValue() {
    final InputColumn<?>[] checkedInputColumns = super.getValue();
    final List<InputColumn<?>> result = new ArrayList<>();
    for (final InputColumn<?> inputColumn : checkedInputColumns) {
        // exclude input columns that have not been mapped yet
        final JXTextField textField = _mappedTextFields.get(inputColumn);
        if (textField != null && textField.isVisible()) {
            if (!StringUtils.isNullOrEmpty(textField.getText())) {
                result.add(inputColumn);
            }
        }
    }
    return result.toArray(new InputColumn[result.size()]);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:16,代码来源:MultipleMappedStringsPropertyWidget.java



注:本文中的org.jdesktop.swingx.JXTextField类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PolicyEngine类代码示例发布时间:2022-05-22
下一篇:
Java OpenBitSet类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap