0

Hi,

Am finding 1 diffculty in jtable pls help me...


i want to set jtextfield value in jtable of particular column and also that jtextfield value will be dynamically changing... even i have tried the below code...

String   mn=jTextField2.getText();
 jTable3.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(mn));

but its not working...

Edited by peter_budo: Keep It Clear - Do use code tags when posting any code

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by mKorbel
0

for why reason(s) you needed that,

in the JTable is there by default JLabel, on CellEdit is there JTextField

0

for why reason(s) you needed that,

in the JTable is there by default JLabel, on CellEdit is there JTextField

------------------------------

Its Simple jtable only with 4 columns
Above the jtable there is 1 textfield for that textfield am reteriving value from database that i want to call in 0 column of the jtable

for column 1 & 2 i have setted the below code its working fine... but for column 0 that textfield value in setting..

String[] when = {"Select","111", "110","101","100","011","010" ,"001"};
        JComboBox combo = new JComboBox(when);
        jTable3.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(combo));

        String[] time = { "Select","AfterMeal", "BeforeMeal" };
        JComboBox com = new JComboBox(time);
        jTable3.getColumnModel().getColumn(2).setCellEditor(new DefaultCellEditor(com));

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.