Solved

Windows explorer type split pane

Posted on 2004-08-24
9
277 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
 
LVL 12

Expert Comment

by:Giant2
ID: 11889475
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java array passed to SQL where clause 23 62
compre toata in where clue oracle 4 56
backtracking recursion  code 19 53
ForLoop Example 3 40
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now