This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Multiple JTables in a single Scrollpane

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
Is it possible to maintain two jtables in a single scroll pane. Actually i am designing a drill down reporting system which requires me to display two completely different types of information side by side which inherit the fucntionality of two different jtables yet are scrollable through a single scroll pane. So the final system should look like.

Thanks in advance.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vishal !
I don't think you can associate multiple tables with single scrollpane.
What you can do is to logically maintaining the contents in two virtual tables in single table.
But if you still want to go with multiple tables, you can associate two tables with two scrollpanes. Make one of them(scrollpane of left table) invisible) and create a bounded event between the two scrollpanes such that if one moves so does the other.
Hope this will solve the problem!
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you could do if you REALLY wanted to is put both tables on a JPanel and put that JPanel in a JScrollPane.
Not sure what you can accomplish with 2 tables in 1 scrollpane that you can't accomplish with 1 table and 2 columns in a scrollpane though.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i did this not long ago
i put all my jtables to jpanel and put it on jscrollpane
but i place jtables vertically
 
Abhinav Anand
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
Actually i have to show 2-3 columns on the left side and another 2-3 columns on the right side of the document. The multiple columns on the left side and the multiple columns on the right side should behave like singe columns. So the user can use left-right arrow keys to tab between them.

Actually i have to show T-Form balance sheet and profit and loss chart in tabular format. I have to show the Asset particulars and amount on the left side and the Libaility particulars and amount on the right side. The above report is backed by a drill down reporting system that gets activated when the user hightlights a particular item and then hits enter or double clicks on the item.
Has anybody tried this or has any idea as to how can i implement the above system using jtables ?
Thanks in advance.
[ September 15, 2003: Message edited by: Vishal Sinha ]
 
It's a tiny ad. At least, that's what she said.
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic