c ca

Greenhorn
+ Follow
since Feb 23, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by c ca

Hi D
I have created my own implementation of TableModel.But I don't no how to do that.You see I am new in Java and every thing is new for me.Can you help me litle bit more.
Thanks
14 years ago
Is there possible to have particular place for one column in jtable.I mean that this particular column will be always in the end of JTable.
???
Regards
CCA
14 years ago
PLS..... Can any body help me ???
14 years ago
Hi
I have a problem with my JTable and I need your help.
Problem:
I have a JTable with 4 columns ( Col A, Col B, Col C and Col D).
Under the JTable I have 3 checkboxes(Col 1, Col 2, Col 3). The user can add a new column to the JTable by choosing one of these checkboxes.I want that when the user choose one of check boxes, the new column will be place before Col D.
Meaning that Col D will be always the last column in table.How can I do this???
my code:
TableColumnModel model = resultTable.getColumnModel();

JLabel checkBoxLabel = new QCLabel("Cols: ");
JCheckBox col1 = new QCCheckBox("Col 1");
JCheckBox col2 = new QCCheckBox("Col2");
JCheckBox col3 = new QCCheckBox("Col3");

if (true) {
TableColumn columnone = model.getColumn(ResultTableModel.COL_ONE );
time.addActionListener(new ColumnKeeper(column1, ResultTableModel.m_columns[ResultTableModel.COL_ONE]));
col1.setSelected(true);
}
if (true) {
TableColumn column2 = model.getColumn(ResultTableModel.COL_TWO);
col2.addActionListener(new ColumnKeeper(column2, ResultTableModel.m_columns[ResultTableModel.COL_TWO]));
col2.setSelected(true);
}
if (true) {
TableColumn column = model.getColumn(ResultTableModel.COL_THREE);
col3.addActionListener(new ColumnKeeper(column3, ResultTableModel.m_columns[ResultTableModel.COL_TREE]));
col3.setSelected(true);
}

public void actionPerformed(ActionEvent e) {

QCCheckBox col1 = (QCCheckBox) e.getSource();
QCCheckBox col2 = (QCCheckBox) e.getSource();
QCCheckBox col3 = (QCCheckBox) e.getSource();
TableColumnModel model = resultTable.getColumnModel();
if (col1.isSelected()) {
model.addColumn(m_column );

} else if (col2.isSelected()) {
model.addColumn(m_column);
} else if (col3.isSelected()) {
model.addColumn(m_column);
} else {
model.removeColumn(m_column);
}
resultTable.tableChanged(new TableModelEvent(_data));
resultTable.repaint();

}

Thanks
regards CCa
14 years ago