Solved

Windows explorer type split pane

Posted on 2004-08-24
9
290 Views
Last Modified: 2013-12-03
Hi,

I am unsure how I will implement the following but I will try phrase the question as best I can, and perhaps someone can point me in the right direction?
  I want a split pane - left component is a Windows explorer type tree of directories only, the right component is a JTable of the files (exclude sub-directories) in the currently selected node.

*the directory tree starts at a specified root location and the user cannot go up a level
*the right pane lists files in a table - associated attributes (from a hardcoded attribute list) can be added / removed as columns in the table -> these attributes
      are XML based and are retrieved from the individual files

Any ideas?? - I want it all to be reuseable,
  *the directory tree specifies a root
  *the file table specifies its attributes

I just want help with:  
 * what classes should I have and extend?
 * any pointers with how to handle the XML idea because I know nothing!!

Thankyou.
0
Comment
Question by:cathalmchale
  • 6
  • 2
9 Comments
 
LVL 12

Accepted Solution

by:
Giant2 earned 50 total points
ID: 11882287
* what classes should I have and extend?
I believe you must extends the Model creating your own (TableModel & TreeModel).

 * any pointers with how to handle the XML idea because I know nothing!!
For managing XML there is java XML API with DOM objects.
0
 
LVL 12

Expert Comment

by:Giant2
ID: 11882314
0
 
LVL 92

Expert Comment

by:objects
ID: 11887171
not sure if you are aware of JSplitPane or not.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 12

Expert Comment

by:Giant2
ID: 11889475
0
 

Author Comment

by:cathalmchale
ID: 11911104
Thanks 4 ur help, it proved not so difficult at all!!
On another point can anyone help?  My JTables are never showing column headers - i extend AbstractTableModel and implement the method:  
    public String getColumnName(int column)
    {
      return visibleFields[column];
    }
but still no headers!! what am i doing wrong?i!
0
 
LVL 12

Expert Comment

by:Giant2
ID: 11911118
If the JTable is displayed in a JScollPane, the Header are visible automatically.
If no, you must add the header manually to the panel where you are displaying.

Bye, Giant.
0
 
LVL 12

Expert Comment

by:Giant2
ID: 11911137
adding manually:
    JPanel ppp=new JPanel(new BorderLayout());
    ppp.add(yourJTable.getTableHeader(),BorderLayout.NORTH);
    ppp.add(yourJTable,BorderLayout.CENTER);
    scrolPane.getViewport().add(ppp,null);
0
 

Author Comment

by:cathalmchale
ID: 11911370
thats it now, thankyou :)

Cathal
0
 
LVL 12

Expert Comment

by:Giant2
ID: 11911382
Thanks.
Happy to help you.

Bye, Giant.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference of if loops 23 62
Java string replace 11 54
jboss 7.1 start up error 1 40
servlet and mdb, jms error 1 35
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

829 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