Solved

TreeTables In Swing

Posted on 2004-09-27
10
419 Views
Last Modified: 2010-05-18
I am looking for an example showing how to browse a local file system.
One way to do this is with a tree table.

I see this:
http://java.sun.com/products/jfc/tsc/articles/treetable1/
but it appears to be somewhat dated.

Is there a more contemporary example?
0
Comment
Question by:allelopath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 4

Expert Comment

by:gdrnec
ID: 12164433
Not sure what you are trying to acheive by browsing a file system. If it is to select a file(s), how about using the JFileChooser class. Makes everything very easy.

    JFileChooser chooser = new JFileChooser();
    // Note: source for ExampleFileFilter can be found in FileChooserDemo,
    // under the demo/jfc directory in the Java 2 SDK, Standard Edition.
    ExampleFileFilter filter = new ExampleFileFilter();
    filter.addExtension("jpg");
    filter.addExtension("gif");
    filter.setDescription("JPG & GIF Images");
    chooser.setFileFilter(filter);
    int returnVal = chooser.showOpenDialog(parent);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
       System.out.println("You chose to open this file: " +
            chooser.getSelectedFile().getName());
    }


Hope this helps
0
 
LVL 1

Author Comment

by:allelopath
ID: 12165647
Nope, not JFileChooser, I've already looked at that, and its not what i need.
I'm making an application in which a source file(s) is selected in the left window and the destination directory is on the right.
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12166588
If you need a Tree table this is an example
http://javaboutique.internet.com/TreeTable/

if you need a commercial treeTable, see this Hierarchical Table of JideSoft
http://www.jidesoft.com/products/grids.htm
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:armoghan
ID: 12166597
the Above link you mentioned is also workable
http://java.sun.com/products/jfc/tsc/articles/treetable1/
0
 
LVL 1

Author Comment

by:allelopath
ID: 12169084
The javaboutique example is an applet, as I said I'm making an application.
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12169287
>>The javaboutique example is an applet, as I said I'm making an application.
The source code is attached in the link, you can extract it JTable code from it.
It will be similarly used in an Application ..

You can aslo see the other examples I have placed as links
0
 
LVL 1

Author Comment

by:allelopath
ID: 12403471
My question has not been answered
armogham suggested 3 sites.
The first is an applet, not an application as i requested.
The second is a commerical application, not an example
The third i had already pointed out.
0
 
LVL 18

Accepted Solution

by:
armoghan earned 50 total points
ID: 12407093
The applet can be converted to an Application as teh source code is available.
Its not a Commerical application , its a commerical component. of treeTable. If you can buy.
The third thing is what you alerady pointed out. I have used it as well once I was evaluating TreeTable.. It work fine as well and is not outdated.
0
 

Expert Comment

by:kindsolutions
ID: 23801099
There is this Outline class:

http://bits.netbeans.org/dev/javadoc/org-netbeans-swing-outline/org/netbeans/swing/outline/Outline.html#expandPath(javax.swing.tree.TreePath)

It does successfully do a Tree Table, however, I am having some problems with it.  First of all, it does not respond to my updateUI() calls to  update the tree itself.  The tree is completely hidden.  I currently need to fix both the updating and figure out how to expand all rows.  I have been able to do it with JTree, but using expandRow(int) and only expandPath(TreePath) exists in Outline, which I haven't managed to use yet.

So the summary, Outline works, but has limitations and even what I'd call bugs.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
V.simple question about Android packages and libraries 1 37
Opening PDF on button click and fill new document 2 54
glassfish admin console 1 21
passing enum to a method 4 35
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question