Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in adding column  RSS feed

 
nabi bux
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if(ae.getActionCommand().equals("Add column"))
{
String s="SINDH UNIVERSITY";

//TableColumn col=new TableColumn(m.getColumnCount() -1);
//col.setIdentifier("ALI") ;
//col.setHeaderValue("AlI");
tb1.addColumn(tb.getColumn(tb.getColumnName(tb.getSelectedColumn()))
);}


the above program work wel but Problem is
that i want that when i add column
the it should be added with "Ali" as headervalue
how can i do that
 
Ko Wey
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't pretend to understand your code:
tb1.addColumn(tb.getColumn(tb.getColumnName(tb.getSelectedColumn()))
I assume that the header of the selectedColumn of tb(tb = a different jTable?)is "Ali"?

In this test-application, a column with header "Ali" is copied from jtable
to jTable1, and it retains its header


Hope it helps!
 
nabi bux
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankd for Reply I want to add column in my table
before adding me ask provide value the value i provid should
be added as Header Value in table
Thank
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!