Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Putting a JTable inside a JTree  (Read 4222 times)
0 Members and 1 Guest are viewing this topic.
Offline SteveJohnson

Senior Newbie




Java games rock!


« Posted 2003-10-26 04:01:04 »

Hello,

 Does anyone have any experience with the subject line. I am creating an object viewer that uses reflection to display all the fields of a selected Object.  Object type fields will be a tree node that can be expanded and will just have the name of the field as a JLabel.  All the primitive data types will be a single tree node as a JTable that can be edited.  I am currently having two problems:

1.) The table is being partially displayed, I can see all the data but the left and top border of the table is missing

2.) I can't select anything, it seems to me that cells can
be highlighted by default on a JTable usually.

I could probably solve everything by making a custom table using JPanels,JLabels,JTextBox, and GridLayout but just wondering if I am missing anything obvious(which is usually the case!). This may not seem related to game development but I am creating an application so that I can view my simple scenegraph and change values on the fly to see the result.

Thanks,
Steve
Offline SteveJohnson

Senior Newbie




Java games rock!


« Reply #1 - Posted 2003-10-26 04:44:57 »

Hello,

 How come everytime I post a question somewhere I always find what I am looking for and I usually find my original question is a stupid one Roll Eyes  .  I found the answer to number 2 (set editable on the tree and write a TreeCellEditor) however number 1 is still a problem.

Thanks,
Steve
Offline duncanIdaho

Junior Member




invert mouse


« Reply #2 - Posted 2003-11-06 21:34:03 »

have you tried putting all the JTables on JPanels?  My first and only thought is to add the table to a panel ( BorderLayout.CENTER ), throw those in the tree, and see how it looks.

I would try this if I felt I had time to screw around with it ... curious component composition.

If you get this working I'd love to see a screen shot and hear how ya did it.  :-)

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2003-11-07 05:48:12 »

Quote
Hello,

 Does anyone have any experience with the subject line.


IIRC do a google for "JTableTree" and "JTreeTable". There was an article/tutorial a very long time ago on the JDC, or swing-pages, or one of the other semi-official java places about implementing a file-system-browser by combining Table and Tree. So, it's probably exactly what you want Smiley.

Whenever I need something similar, I just go and look up that article/tutorial/etc. I don't think it's part of any of the Swing trails though I could be wrong...

malloc will be first against the wall when the revolution comes...
Offline sma

Junior Member





« Reply #4 - Posted 2003-11-07 06:41:04 »

Quote

IIRC do a google for "JTableTree" and "JTreeTable". There was an article/tutorial a very long time ago on the JDC

It was on "The Swing Connection": http://java.sun.com/products/jfc/tsc/articles/treetable1/

.: Truth Until Paradox!
Offline duncanIdaho

Junior Member




invert mouse


« Reply #5 - Posted 2003-11-07 15:53:57 »

Nice!  It looks much more useful than I had imagined.

Not that this site is hard to find, but it taught me a lot about getting Swing to jump through hoops ( despite being low on comments ).

http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
Offline Golthar

Junior Member




;)


« Reply #6 - Posted 2003-11-07 18:36:17 »

I have trouble imagining what it would look like  Grin

Somebody post pictures please

come visit us: http://www.otf1337.com
Offline duncanIdaho

Junior Member




invert mouse


« Reply #7 - Posted 2003-11-07 18:56:23 »

just click sma's link.  Wink
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #8 - Posted 2003-11-09 14:22:56 »

FYI a much more detailed and performance-sensitive look at tabletrees (starting with 40 slides on Jtree and Jtable) can be found here:

http://servlet.java.sun.com/javaone/javaone2000/pdfs/TS-1136.pdf

You need to understand quite a bit about standard patterns in order to make sense of the slides, and clearly it would be a LOT easier to follow if you had the text of the presentation, but it's got some good content in there (and covers the "mutual-selection infinite recursive loop" problem that bites a lot of people in the ass Smiley).

malloc will be first against the wall when the revolution comes...
Offline SteveJohnson

Senior Newbie




Java games rock!


« Reply #9 - Posted 2003-11-14 00:01:46 »

Hello,

 Thanks for the replys.  I haven't made any progress other than getting the editing working a bit.  Works not bad though, handy to be able to change values on the fly and see what happens. Anyways, I am in the Navy and just got back from a couple of weeks at sea so I wasn't ignoring you guys.

Thanks,
Steve
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (13 views)
2014-07-24 01:59:36

Riven (14 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (39 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!