I have a JXTreeTable with an add button. The button works as expected: it adds a new node to the end, with values that (for the purpose of testing) are hard-coded into my program. The line:

```
modelSupport.fireChildAdded(new TreePath(root), noOfChildren-1, dataNode);

```

tells the JXTreeTable to recognise the update made to the TreeTableModel, and to refresh accordingly.

I then execute:

```
treeTable.changeSelection(treeTable.getRowCount()-1, 0, false, false);

```

to automatically select this new node. This works as expected, BUT I also expected it to automatically scroll to bring this new node into sight, which it does not. Instead, it scrolls to show only the penultimate node, leaving the new node hidden just slightly beyond view.

I've also tried using tricks to programmatically scroll to the final record. However, this code:

```
JScrollBar vertical = scrollPane.getVerticalScrollBar();
vertical.setValue(vertical.getMaximum());

```

revealed the same problem.

Bizarrely, if I attach either of the above two blocks of code to a "Scroll to Bottom" button, and press this button manually after adding the new node, it all works fine! Please can anyone isolate the cause of this bug, or offer a fix/workaround?
['https://Stackoverflow.com/questions/25467734', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/313909/']
Give it a Name

```
<Page.Resources>
    <Flyout x:Name="myFlyout" x:Key="WinningPopup">
        // ......
    </Flyout>
</Page.Resources>

```

Then you can just Hide()

```
myFlyout.Hide();

```

[FlyoutBase.Hide method](http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.primitives.flyoutbase.hide.aspx)
```
public void btnRestart_Click(object sender, RoutedEventArgs) 
{
    ((((sender as Button).Parent as StackPanel).Parent as StackPanel).Parent as Flyout).Hide();
}

```

Very ugly but should work.