0

Can anybody please point me the direction, how I can achieve below behavious using JTable?

http://www.jankoatwarpspeed.com/examples/expandable-rows/

I need some sample code to make image clickable(changing Expand/Collpase images) in the cell.

Please help.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
user1483570
  • 51
  • 3
  • 10
  • http://stackoverflow.com/search?tab=relevance&q=[java]%20swing%20accordion – assylias Jun 26 '12 at 17:50
  • possible duplicate of [Java Swing accordion in Nimbus look and feel](http://stackoverflow.com/questions/10030002/java-swing-accordion-in-nimbus-look-and-feel), in particular [this answer](http://stackoverflow.com/a/10042185/829571). – assylias Jun 26 '12 at 17:52
  • @assylias maybe not duplicate (how I can achieve below behavious using JTable) ??? – mKorbel Jun 26 '12 at 18:03
  • @mKorbel & assylias - Thanks for your comments. But I need Expand Collpase behaviour for JTable. Specially some sample code, to start with, where clicking on "+" image will change to "-" image and expand/show the row details. – user1483570 Jun 26 '12 at 18:10
  • The javaScript code you point to, which is really nice, achieves part of the trick by setting `colspan=4` on the table cell. You can't easily do that with a JTable. See question: http://stackoverflow.com/questions/6199392/jtable-row-span-and-column-span – Enwired Jun 26 '12 at 21:00

1 Answers1

3

point me the direction, how I can achieve below behavious using JTable?

have look at (died project) JTreeTable, excelent workaround by

Community
  • 1
  • 1
mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • 1
    Indeed. SwingX has a `JXTreeTable` which allows to do this – Robin Jun 26 '12 at 20:05
  • @Robin naturally delighted by your trust in the omni-potence of SwingX :-) But the sample linked to by the OP cannot be achieved with JXTreeTable nor by any of the other links provided here except JIDE (their component is called HierarchicalTable) – kleopatra Jun 27 '12 at 09:20
  • @kleopatra Time to log an enhancement request then :-) . I was pretty sure that it was possible but I did not try it. Luckily you came by to correct my assumption – Robin Jun 27 '12 at 09:50
  • @both I don't know how, where and what.. if is that possible in SwingX (treecellrenderer), but aephyr override treecellrenderer and/or with block for tablecellrenderer – mKorbel Jun 27 '12 at 10:44