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

Need to populate a table when row clicked should open another table on the same table  RSS feed

 
Rajahari Kannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

im new to java. im trying to populate a table (with expand and collapse) and if i click a row it should show a table below itself... it should not be as a tree structured like

a
|
--b
|
---c

i want

1. to populate a table
2. each row contains a data of other table
3. so if i click a row it should open a new table on the same table itself .....

help me out guys ..... im trying this for nearly a week....
 
K. Tsang
Bartender
Posts: 3630
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

What have you tried? How are you setting up your table model? Are you using any cell renderer for the sub-table part?
 
Rajahari Kannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have tried to populate a table from the database and i am also not able to understand how jtree works.... i use the default table model for my table to be populated....

i havent started with my subtable part.... i do not know where to start with...

kindly help me ......
 
Rajahari Kannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maneesh ,

i have another doubt to is that posible to make a basic Jtable populated in a tree structure....
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you even bother to go through the links I had provided?
 
Rajahari Kannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh

i am goin through the links that you have given....

im working on it.... do not mistake me plzzz

i just had a curiosity to know that is it .....
 
Rajahari Kannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

i went through the topics and now i have a doubt can i populate a treetable from database.

since i googled and cannot find anything such thing like that so i asked..
 
Campbell Ritchie
Sheriff
Posts: 53773
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how are you connecting to your database?
 
Rajahari Kannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried connecting to the database only with JTables like.



I dont know how to connect with treetable .....
 
Campbell Ritchie
Sheriff
Posts: 53773
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove everything about tables and print the results of a select statement to the command line. That will confirm your connection is working correctly.
If you have multiple results, you can put them into a table model.
I can never remember how to use tables, so I would have to send you to the Java Tutorials section.

By the way: have you come across our code button. I have edited your post with the code button, and broken the long lines so you can see how it works and how much easier it is to read
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!