TreeTableView Scrollbar Not Responsive Once Node is Collapsed

I've created a TreeTableView using a folder/file structure, I start all of the tree nodes to be expanded.  The vertical scrollbar does respond at that point as expected by scrolling the treatable content.  However, if I collapse one of the parent nodes the vertical scrollbar does not scroll the content consistently.  Sometimes it works and sometimes the content does not scroll at all, when I re-expand the node it still does not reset the vertical scrollbar.
I'm using Java(TM) SE Runtime Environment (build 1.8.0-ea-b114) on Mac OSx Mavericks.

package treetablescrollingbug;
import java.io.File;
import java.text.DateFormat;
import java.text.NumberFormat;
import java.util.Comparator;
import java.util.Date;
import javafx.application.Application;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeTableCell;
import javafx.scene.control.TreeTableColumn;
import javafx.scene.control.TreeTableView;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import javafx.util.Callback;
public class TreeTableScrollingBug extends Application {
    private final static NumberFormat NumberFormater = NumberFormat.getIntegerInstance();
    private final static DateFormat DateFormater = DateFormat.getDateTimeInstance();
    private TreeTableView<File> treeTblFolderStructure;
    @Override
    public void start(Stage primaryStage) {
        this.treeTblFolderStructure = new TreeTableView<>();
        this.buildFileBrowserTreeTableView();
        AnchorPane root = new AnchorPane();
        AnchorPane.setTopAnchor(this.treeTblFolderStructure, 10.0);
        AnchorPane.setLeftAnchor(this.treeTblFolderStructure, 10.0);
        AnchorPane.setRightAnchor(this.treeTblFolderStructure, 10.0);
        AnchorPane.setBottomAnchor(this.treeTblFolderStructure, 10.0);
        root.getChildren().add(this.treeTblFolderStructure);
        Scene scene = new Scene(root, 640, 480);
        primaryStage.setTitle("TreeTableView Vertical ScrollBar BUG");
        primaryStage.setScene(scene);
        primaryStage.show();
    private void buildFileBrowserTreeTableView() {
    TreeItem<File> root = createNode(new File("/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk"));
    root.setExpanded(true);
    this.treeTblFolderStructure.setShowRoot(true);
    this.treeTblFolderStructure.setRoot(root);
    // --- name column
    TreeTableColumn<File, String> nameColumn = new TreeTableColumn<File, String>("Name");
    nameColumn.setPrefWidth(300);
    nameColumn.setCellValueFactory(
            new Callback<TreeTableColumn.CellDataFeatures<File, String>, ObservableValue<String>>() {
        @Override
        public ObservableValue<String> call(TreeTableColumn.CellDataFeatures<File, String> p) {
            File f = p.getValue().getValue();
            String text = f.getParentFile() == null ? "/" : f.getName();
            return new ReadOnlyObjectWrapper<String>(text);
    // --- size column
    TreeTableColumn<File, File> sizeColumn = new TreeTableColumn<File, File>("Size");
    sizeColumn.setPrefWidth(100);
    sizeColumn.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<File, File>, ObservableValue<File>>() {
        @Override public ObservableValue<File> call(TreeTableColumn.CellDataFeatures<File, File> p) {
            return new ReadOnlyObjectWrapper<File>(p.getValue().getValue());
    sizeColumn.setCellFactory(new Callback<TreeTableColumn<File, File>, TreeTableCell<File, File>>() {
        @Override public TreeTableCell<File, File> call(final TreeTableColumn<File, File> p) {
            return new TreeTableCell<File, File>() {
                @Override protected void updateItem(File item, boolean empty) {
                    super.updateItem(item, empty);
                    TreeTableView treeTable = p.getTreeTableView();
                    // if the File is a directory, it has no size...
//                    if (getIndex() >= treeTable.impl_getTreeItemCount())
//                        setText(null);
//                    else
                        TreeItem<File> treeItem = treeTable.getTreeItem(getIndex());
                        if (item == null || empty || treeItem == null ||
                                treeItem.getValue() == null || treeItem.getValue().isDirectory()) {
                            setText(null);
                        } else {
                            setText(NumberFormater.format(item.length()) + " KB");
    sizeColumn.setComparator(new Comparator<File>() {
        @Override public int compare(File f1, File f2) {
            long s1 = f1.isDirectory() ? 0 : f1.length();
            long s2 = f2.isDirectory() ? 0 : f2.length();
            long result = s1 - s2;
            if (result < 0) {
                return -1;
            } else if (result == 0) {
                return 0;
            } else {
                return 1;
    // --- modified column
    TreeTableColumn<File, Date> lastModifiedColumn = new TreeTableColumn<File, Date>("Last Modified");
    lastModifiedColumn.setPrefWidth(130);
    lastModifiedColumn.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<File, Date>, ObservableValue<Date>>() {
        @Override public ObservableValue<Date> call(TreeTableColumn.CellDataFeatures<File, Date> p) {
            return new ReadOnlyObjectWrapper<Date>(new Date(p.getValue().getValue().lastModified()));
    lastModifiedColumn.setCellFactory(new Callback<TreeTableColumn<File, Date>, TreeTableCell<File, Date>>() {
        @Override public TreeTableCell<File, Date> call(TreeTableColumn<File, Date> p) {
            return new TreeTableCell<File, Date>() {
                @Override protected void updateItem(Date item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item == null || empty) {
                        setText(null);
                    } else {
                        setText(DateFormater.format(item));
    this.treeTblFolderStructure.getColumns().setAll(nameColumn, sizeColumn, lastModifiedColumn);
private TreeItem<File> createNode(final File f) {
    final TreeItem<File> node = new TreeItem<File>(f) {
        private boolean isLeaf;
        private boolean isFirstTimeChildren = true;
        private boolean isFirstTimeLeaf = true;
        @Override public ObservableList<TreeItem<File>> getChildren() {
            if (isFirstTimeChildren) {
                isFirstTimeChildren = false;
                super.getChildren().setAll(buildChildren(this));
            return super.getChildren();
        @Override public boolean isLeaf() {
            if (isFirstTimeLeaf) {
                isFirstTimeLeaf = false;
                File f = (File) getValue();
                isLeaf = f.isFile();
            return isLeaf;
    node.setExpanded(true);
    return node;
private ObservableList<TreeItem<File>> buildChildren(TreeItem<File> TreeItem) {
    File f = (File) TreeItem.getValue();
    if (f != null && f.isDirectory()) {
        File[] files = f.listFiles();
        if (files != null) {
            ObservableList<TreeItem<File>> children = FXCollections.observableArrayList();
            for (File childFile : files) {
                children.add(createNode(childFile));
            return children;
    return FXCollections.emptyObservableList();
    public static void main(String[] args) {
        launch(args);

Similar Messages

  • TreeView - Expand only selected node and collapse others

    Hi
    How I can expand only selected node and collapse other nodes that was expanded earlier?!

    Ghostenigma,
    switch Option Strict On. I've tried to analyze the code but it's not usable due to type ignorance.
    BTW, Goto is not required here. ELSEif means it's only executed if the previous expressions are not true.
    Armin
    Ignore other code and give an reply for what I've asked else you are not obligated to post a reply at all!
     I am not sure if you took the "type ignorance" part wrong but, Armin was only trying to give you helpful information which i would give too.  Option Strict is a GOOD thing to use and the GoTo statements are not needed inside your ElseIf
    statements.  As far as that goes, i would not recommend using GoTo in any modern .Net programming.
     Anyways, the problem is with the way you are Adding and Removing all the child nodes every time the nodes are DoubleClicked and when they are Collapsing.  I just simulated your code to add the sub nodes when a main node is double clicked. 
    You can just use the NodeMouseDoubleClick event instead of the TreeView`s DoubleClick event to make it a little easier on yourself too.
     This corrected the problem for me.
    Public Class Form1
    Private r As New Random ' this random class is only for my simulation of adding sub nodes (not needed)
    Private expanded As TreeNode
    Private Sub TreeView1_BeforeCollapse(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles TreeView1.BeforeCollapse
    e.Node.Nodes.Clear()
    End Sub
    Private Sub TreeView1_BeforeExpand(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles TreeView1.BeforeExpand
    Dim pn As TreeNode = e.Node
    While pn.Parent IsNot Nothing
    pn = pn.Parent
    End While
    If expanded IsNot Nothing And expanded IsNot pn Then expanded.Collapse()
    expanded = pn
    End Sub
    Private Sub TreeView1_NodeMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles TreeView1.NodeMouseDoubleClick
    'Added this part to collapse the prior expanded node and set the (expanded) node to the new one
    If expanded IsNot Nothing And expanded IsNot e.Node Then
    expanded.Collapse()
    Dim pn As TreeNode = e.Node
    While pn.Parent IsNot Nothing
    pn = pn.Parent
    End While
    expanded = pn
    End If
    'This just simulates your code to add the new sub nodes to the main node that was double clicked
    'you need to put your code here instead of this.
    Dim str() As String = {"one.mp3", "Two.mp4", "Three.mvk"}
    Dim s As String = str(r.Next(0, 3))
    e.Node.Nodes.Add(s, s)
    e.Node.Expand()
    End Sub
    End Class
     PS - I notice you are adding more and more Images to your ImageList every time you double click on a node.  If you just add the Images to it once when the app is loading then you can just use the Image Key to set the correct Image to the newly
    added node.
    If you say it can`t be done then i`ll try it

  • Windows 8.1 Flash CC 2014 Not responsive for about 30 seconds every 10 mins or so... Trying 30 day trial.

    I am trialing CC 2014 to open some files from an animator. It locks up all the time for between 10 to 60 seconds. It picks up fine once it wakes back up, but it happens very regularly and doesn't seem to relate to any particular activity.
    During this time it is marked in the task manager as (Not responsive) It doesn't seem to be taking up a huge amount of CPU or disk read/write during this. It happens whether I have the network connected or not.
    It's the only thing on my laptop that does this. I have CS4 installed and it doesn't have this issue.
    My laptop has 16GB ram, quad core i7 and good size solid state with over 100GB free space that can do 550MBps.
    Is anyone else having these issues? It's unusable, but it's giving me plenty of tea breaks so I suppose that's something.
    I know someone who seems to have similar issues on Flash CS6.
    Thanks,
               Mike

    Wooah, yeah I think that's done it. Also seems to have fixed it for my friend using CS6. Thanks for the help. I guess I was right with my every 10 minutes estimate then, it was exactly 10 minutes
    Surprised it locks it up so bad though. Maybe there should be a warning message if it regularly takes longer than a few seconds telling you what it was and how to disable it.
    Thanks,
                Mike.

  • After ICS Update of almost a month My Xperia Neo V is not booting, Once i switched on my bluetooth Device

    Hi,
    After Official Sony ICS update 4.0.4, my neo v is not booting, once i turn on my bluetooth device. Can any one help me on this. I have tried all the possible ways to boot,. Bu finally everything ended with vains.
    Regards,
    Sudhan

    If you get some form of response (vibration, blinking LED etc) when you try to power it on then please try running a repair:
    1. Before you start you have to download the PC Companion software from http://www.sonymobile.com/gb/tools/pc-companion/
    and install it on your PC.
    2. Once installed on your PC, double-click the PC Companion icon on your desktop to start the update.
    Note! For some models you will be prompted to do a backup prior to the update and then restore.
    3. Install and open PC Companion then select Support Zone.
    4. Phone Software Update.
    5. Start.
    6. Repair Phone
    7. Continue
    8. Accept data removal
    9. Next
    10. Wait for prepare
    11. Select Phone
    12. Follow the connection steps
    What are your thoughts about this forum? Let us know by doing this short survey.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Printer control panel is not responsive.

    touch printer control panel is not responsive. The power button is responsive as well as the  nfc  button. Need help please

    Hey ,  Welcome to the HP Support Forum.  I see that your HP ENVY 7640 e-All-in-One Printer's front panel is not functioning.  I would like to assist you with this.  Have you tried a hard reset?  1. Ensure your printer is powered on.
    2. Disconnect the power cord from the rear of the printer.
    3. Wait 60 seconds.
    4. Reconnect the power cord to the rear of the printer.
    5. Press the Power button to turn on the printer (if it doesn't automatically reboot).  There are more advanced reset steps available but they're no good to you if the printer won't allow for you to navigate through the touch screen menus.  If this basic tip restores front panel functionality let me know and I'll private message you the semi-full reset steps.  Otherwise I recommend you reach out to our tech support team. You can click on the following link to initiate a case: www.hp.com/contacthp/
    Once you fill out the online form to create your case you can choose from different direct contact methods. Thanks for posting in the HP Support Forum.  Have a great day!

  • Print not response when i connect T1100 Epson to router RT-N16 ASUS with USB port???

    For my macbook pro that I brought July 2010. I can print with T1100 Epson printer connect directly to my mac but when I connect T1100 to ASUS Router RT-N16 with USB port and I assign print to T1100 pass through wireless It's not response. How do we do please ???
    Many Thanks for your answer...

    Hello Shawnondrums,
    Welcome to the HP Forums.
    I see that you are having an issue with the printer shutting down when attempting to connect to the wireless network.
    A very important step that gets easily over looked is, please make sure that you have the printer power cable connected directly to a wall outlet and not a power bar/strip. Here is a document that uses a LaserJet printer as an example but it is meant for HP products in general. Please click on the following link that explains the Issues when Connected to an Uninterruptible Power Supply/Power Strip/Surge Protector.
    Once the printer is back on, please use the on/off button to do a proper shut down and restart.  This will also do a semi power reset on the printer.
    If the troubleshooting does not help resolve your issue, I would then suggest calling HP's Technical Support to see about further options for you. If you are calling within North America, the number is 1-800-474-6836 and for all other regions, click here: click here.
    Thanks for your time.
    Cheers,  
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

  • Hello. Just got Garageband'11 for my ipad 2. Can´t seem to be able to play more than two notes at once on touch keyboard. Help!

    Hello. Just got Garageband'11 for my ipad 2. Can´t seem to be able to play more than two notes at once on touch keyboard. Help!

    Thank you for your response.
    I am trying to sync them both to the same computer (Windows), and with the 2nd ipod, it looks like everything is going to work out fine, until I go to add songs from my itunes music library...then, after a few seconds of me hoping it will work, I get a message that says "Attempting to copy to Lisa's disk failed. The disk could not be read from or written to."
    I thought it might have been my ipod. But then I tried to download songs from my sister's computer, and even my work computer (just to see if it would work), and it did. So I'm not sure what is going on here. Is it my computer, or is it the ipod? Or is it itunes?
    Also, my sister in-law said her issue is similar, in that her itunes doesn't recognize her ipod now that my brother's ipod has been used on their computer. She gets the same message as I do...thus she is unable to download any songs onto her ipod.
    If you have any helpful tips, it would be greatly appreciated.
    Thank you for your time and assistance.
    -- Lisa Soto

  • TS1702 iPad is not responding. It ONLY shows an iTunes icon and a USB cable in the middle of an all black screen. Have tried to reset it (not responsive), link to iTunes (not recognized), etc.

    iPad is not responding. It ONLY shows an iTunes icon and a USB cable in the middle of an all black screen. I have tried to reset it manually and via iTunes (not responsive), linked it to iTunes (not recognized), etc. Nothing works. This happened after an iTunes updated, after I was asked to "restore" my iPad to factory settings.

    Thanks, King_Penguin. Yes, I tryied putting the iPad into recovery mode. It freezes in the black screen with the iTunes and USB cable. When I followed the instructions and then started iTunes, I received the following message: "A required iTunes component is not installed. Please repair or reinstall iTunes (-424040)".
    I have unistalled iTunes three times already and donloaded and installed three new versions. No luck.
    Thanks a billion once again!

  • How to add a field in the view not in context node

    Hi All,
            I want to add a new field in one of my views. The problem is that the field does not exist in the context node. I have checked in the BOL model there it comes under another root object. I would  like to know whether it is possible to add the field from another root object.
    can you please help to me to solve this issue.
    Advance Thanks & Regards
    Sujith

    Hi Ashish,
                  I will give a detailed explanation of my requirement. I am working in ICWEB client for utility services, In this case for a particular view in the bsp application CRM_IUFCS_IC/View1.htm i want to add a field but the field is not the context nodes, or any of the related entities in the BOl Model. But its in  another root object in the BOL Model. So i would like to know how can i add this field into my layout.
    e.g.:let context node in view to be modified is buag and the field to be added is under BuilHeader object. This is the scenario.
    Advance Thanks,
    Sujith

  • Import not allowed on nodes of type element declaration

    I have 2 very simple transformation processes, consisting of:
    1. hit a web service
    2. filter the output
    3. transform into a variable of type defined by a schema document
    4. get the variable as a string
    5. call another web service and pass the string
    The processes are identical except for the variable type. One process works, the other fails when converting to a string. Here is the error message:
    <2005-10-25 11:33:40,627> <ERROR> <default.collaxa.cube.xml> ORABPEL-09500
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "orcl:get-content-as-string(bpws:getVariableData("OutputDocument"))", the reason is import not allowed on nodes of type element declaration.
    I can successfully use an xsl to convert the variable to a string, but when I utilize the assign activity, it produces the error above. Obviously, the schema files are different for the 2 variables, but I cannot see a problem. The schemas are both valid.
    Has anyone encountered this error?
    Thanks,
    Dave

    The cast does not throw an exception, but the resulting string is empty.
    The problem is that I do not understand the error message. I am not sure what import it is referring to.
    Thanks

  • Hyperlinks in presentation not working once published - Presenter 7.0.7

    I have a link to an intranet address that will not work once the PowerPoint presentation has been published via Presenter 7.0.7.  The cursor does not change to a pointer and nothing launches when the link is clicked.  I have verified the Flash Player security settings as well as ensured no formatting of the text link except for the color change that happens when the link is inserted.
    The issue (slide 37) can be viewed at:  http://www.pivotpointelearning.com/docs/TTE7161/index.htm
    Any ideas?
    Ray

    Hi Ray,
    Thanks for sharing the presentation.
    Textbox in which your hyperlink is placed have text containing Text effects. When you publish the presentation then any text with text effect is published as an image.
    So, place text with a hyperlink in a separate textbox which don't have any text effects. Segregate the content having text effect and hyperlink in 2 separate textbox.
    Thanks,
    Shubhi

  • Scrollbar not working in a JScrollPane

    In the JDialog there is a JScrollPane. JTextPane is in a the scroll pane. For some reason the scrollbars are not working.
    Any suggestions on this why the scrollbars not working?
    Thanks.

    using the setText() method the text is set to the text pane from some other package. the Dialog displays the text too with the vertical scroll bar that doesn't work.
    public MyDialog(JFrame frame) {
    super(frame);
    initialize();
    private void initialize() {
    this.setResizable(true);
    this.setName("");
    this.setUndecorated(false);
    this.setContentPane(getScrl());
    this.setSize(400, 300);
    this.centerDialog();
    private javax.swing.JScrollPane getScrl() {
    if (scrl == null) {
    scrl = new javax.swing.JScrollPane();
    scrl.setViewportView(getTxt());
    return scrl;
    private javax.swing.JTextPane getTxt() {
    if (txt == null) {
    txt = new javax.swing.JTextPane();
    txt.setBackground(java.awt.SystemColor.info);
    txt.setEditable(false);
    return txt;
    public void setText(String text) {
    if (txt.getEditorKit() == null) {
    txtToolTip.setEditorKit(new StyledEditorKit());
    txt.setContentType("text/html");
    txt.setOpaque(true);
    txt.setText(text);

  • Why is the payment for e.g. a song in the itunes store proceeding not at once but after indefinite time?

    Why is the payment for e.g. a song in the itunes store proceeding not at once but after indefinite time?

    If you are using your account's balance then the price of the song should be deducted from it immediately, if you are using a credit card then it may take a day or two for it to appear on your card's statement

  • Trackpad not responsive when MB connected to an external device

    After I installed Maverick on my MP retina, every time I connected my smartphone the screen freezes and the trackpad is not responsive anymore. Never happened before. What shall I do? Reinstall Lion? Thanks.

    The higher resolution is pushing you to the next higher rendering resolution.  If you are in Develop and set zoom position to 1:4 or 1:8 it should speed back up (each level is 4 times as fast as tge previous).

  • Macbook pro 2011 mouse / keyboard not response in heavy load

    When I am playing games in the 2011 Macbook pro. Mouse clicks / keyboard sometimes not response or delay, this occur when the machine under heavy load.
    This won't happened in my old BLACK core duo Macbook.
    Does everyone notice this?

    If your machine is less than a month old, you should use your warranty and call AppleCare (you have 90 days of phone support) or take your machine back to the Apple Store (make an appointment with the Genius Bar first) and let them deal with the issue.
    If yours is the 13" model, there is a thread on here (somewhere) about trackpad and keyboard failures when also using Bluetooth, I think (don't quote me on that - I don't have the affected machines so I don't follow the thread too closely).
    But I do believe that Apple is aware of the issue and had 'fixed' it in either a patch preceding 10.9.4 or in 10.9.4 itself.
    Give them a call...
    Clinton

Maybe you are looking for

  • [iphone app store] releasing "trial" version app

    i'm sure others have this need, but i can't seem to find info on it. we are releasing an app in which we could make two versions one for free and one that costs money. thing is, we would need people with the free version to "upgrade" to the full vers

  • DEPOT Excise Invoice.

    Hi I am created  Depo SO-> Depot Delivery. Now i am doing J1IJ against Depot Delivery, i am not able to see the Excise duties for Excise Invoice. While MIGO Incoming excise invoice created & it has excise Duties. any config missing? Reg, Antaa21

  • How to read xml file and place it into an internal table...

    hello all, can any one help me in - how to read xml data file (placed in application server) and placing the same into an internal table (remove the xml tags or say fetching the xml data without xml tags).

  • BANK PARNTER TYPE

    Respected Professionals, I am not able to pay the invoices using particular Partner Bank Type I am getting an error like "Please choose a valid Bank Partner Type" I checked in FK03 also and bank partner type is duly assigned So could you please guide

  • Can't drag and drop album artwork

    I have been dragging artwork from Safari into the Artwork pane in iTunes for quite a while, but just recently I can no longer do it. Anyone else?