• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable or JXTreeTable with expandable rows and column spanning  RSS feed

 
nick woodward
Ranch Hand
Posts: 382
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I posted on stackoverflow yesterday asking about the posibility of a table that resembles this:



From the looks of things, a JXTreeTable can fulfil the expandible side of things, but there seems to be no way to make either the parent or child node span different numbers of columns (as shown above in the childNode). Other questions I've seen are old, go unanswered, or have broken links. One in particular says it's not possible. But is this still the case? It seems pretty strange that it isn't possible, unless I'm looking at using completely the wrong type of object.

An alternative I'm thinking of is just to have a pop-up appear just below when the cell is hovered, which spans the width of the table. But it's certainly not as nice a solution.

Any help would be appreciated,

Thanks,

Nick
 
Les Morgan
Rancher
Posts: 779
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nick,

Sorry I was not in last week to see your post, but if you're still looking: you can do what you ask in a JScrollpane using HTML, there are a couple of ways to do it, but clever formatting of the HTML div objects using style sheets will accomplish what you want. I had a similar project in C# this last week, and out project turned out beautiful and executed exacly as the client wanted it to display.

Les
 
nick woodward
Ranch Hand
Posts: 382
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Les. I'm definitely interested in what you're saying, but am a bit confused as to how i'd achieve it? would i apply the html in the columnrenderer if the row was divisible by 2? sorry, i'm not great with tables!

this has gone on the back burner since i *almost* solved it last week. i made an SCCE, passing the standard Jtable width and (cell height * row number (+1)) to a JDialog and got it to popup on clicking a column (column B):



but it's definitely a bit buggy, and i can't get the bloody JDialog to disappear! i've tried setting visible(false), dispose() - none of it works.

perhaps your html method is a better way to go

thanks,

nick

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!