How to change Binding property column name of jtable?
<p>This is my first time using java binding so I created this method to help me.</p>

<pre><code>public static final void BindTableToFields(JTable Table, Object[] Fields) {
    for (Object Field : Fields) {
        if (Field instanceof JTextField) {
            JTextField jTextField = (JTextField) Field;
            BeanProperty&lt;JTable, Object&gt; tableBeanProperty;
            BeanProperty&lt;JTextField, String&gt; textFieldProperty;
            Binding&lt;JTable, Object, JTextField, String&gt; binding;

            tableBeanProperty = BeanProperty.create("selectedElement." + jTextField.getText());
            textFieldProperty = BeanProperty.create("text");
            binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, Table, tableBeanProperty, jTextField, textFieldProperty);
            binding.bind();
        }
    }
    return;
}
</code></pre>

<p>Now when I go to my designed frame and I set my JTextField text property to 'column1' the binding successfully works.</p>

<p>I tried to rename all my JTable columns names using this snippet of code.</p>

<pre><code>public static ResultSet FillTableDataFromQuery(String Query, JTable table) throws SQLException {

    ResultSet rs = SQLTools.ExecuteQuery(Query);
    DefaultTableModel defaultTableModel = new DefaultTableModel();

    // Filling table model with data from database
    // ... (cutting irrelevant code)

    table.setModel(defaultTableModel);
    for (int i = 0; i &lt; table.getColumnCount(); i++) {   
        table.getColumn(table.getColumnName(i)).setIdentifier(heads[i]);
    }
    return rs;
}
</code></pre>

<p>I'm filling data of the JTable then I use the binding method.</p>

<pre><code>public final void InitFrame() throws SQLException {
    jtable1RS = FillTableDataFromQuery("SELECT * FROM users ;", jTable1);
    JTableSQLTool.HideColumns(jTable1, new int[] { 0, 1, 3 });
    JTableSQLTool.BindTableToFields(jTable1, new Object[] { JTF_ID, JTF_PAss, JTF_Profile, JTF_User });
}
</code></pre>

<p>This picture below illustrates my results.</p>

<p><a href="https://i.stack.imgur.com/4roiX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4roiX.png" alt="binding works successfully"></a></p>

<p>Now for my problem, is there a way to change the table column property name from <code>selectedElement.column1</code> to <code>selectedElement.ID</code>? This will make my design more significant.</p>

<p>I tried to use this code in the second method to rename <code>column1</code> to <code>ID</code> but it does not work.</p>

<pre><code>for(int i = 0; i &lt; table.getColumnCount(); i++) {
    table.getColumn(table.getColumnName(i)).setIdentifier(heads[i]);
}
</code></pre>