JavaFX [1.3] - TreeView


JavaFX 1.3 has TreeView as preview control. Here I'll demonstrate how to use it to implement a File Browser. For this, we need to implement a custom TreeView.cellFactory which will return a TreeCell instance (View) and provide an implementation for TreeItem (Model). TreeItem.createChildren is implemented so as to add more and more items, as and when user expands the nodes (Drive/Directory).

<script src="http://dl.javafx.com/1.3/dtfx.js"></script> <script src="http://javafxdemos.googlecode.com/hg/resource/FileBrowser/FileBrowser.js"></script>

For Applet mode, click on above image

For standalone mode

Try all preview controls and give your valuable feedback and file RFEs/Bugs in JavaFX - JIRA

Comments:

Hello and thanks, Rakesh! :)

Have anybody problem like mine about this demo?

Script works properly at all, but time interval between starting and showing first info is unacceptable:(

1. It is not because 'cold start' and so on-> I certainly see moment, when script starts and about 5-10 seconds nothing happens, only blank screen.
2. CPU usage is about 1..5 %, so it is not reason
3. My drive is only 150Gb and system is fresh enogh
4. Maybe script tries get FULL info before showing first screen with 4 labels ( A: C: D: E:)?
No, when I tried expand C:, the same amount of waiting appears...

Java version 6.20, JavaFX - 1.3 Windows7 64bit

Something inproperly, I think...

Posted by Anatoliy on May 15, 2010 at 01:40 PM IST #

@Anatoliy Thanks for feedback. Script is not getting all info before showing first screen. It just makes one call -> File.listRoots() Did you see same performance issue with webstart mode? When you click on "C:" it will try to get list of files directly under "C:" drive using File.listFiles(). So looks like all file operations are slow. I haven't faced this issue, may be we can try to reproduce same issue with standalone. Then we can time the method File.listRoots()/listFiles() using simple command line java program and compare.

Posted by Rakesh Menon on May 17, 2010 at 07:22 AM IST #

Hello!

Web Start mode does not change appearance...

As I wrote before, program starts with white screen, which lasts about 5-10 seconds, CPU usage is very low.

After that, I can see root drives A: C: D: E:

When I try expand C: program freeze and more than 5 seconds go before content of C: is seen.

New symptom: collapsing of content of C: take several seconds also :(

New simptoms -

Posted by Anatoliy on May 17, 2010 at 10:41 AM IST #

@Anatoliy I will have to find a Windows7 64bit system to reproduce this. Couldn't reproduce issue on Mac and Win-Vista.. I will try this out..

Posted by Rakesh Menon on May 17, 2010 at 10:46 AM IST #

Post a Comment:
Comments are closed for this entry.
About


The views expressed on this blog are my own and do not necessarily reflect that of my organization

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today