title: SwingNode contents not resizing when the SwingNode's parent resizes
body: <p>EDIT:
  I've left my original question as it was, below. If you wish to test the issue using the AnchorFX sourcecode and my code below, you should be able to recreate the problem. It happens in some other circumstances as well, and is similar to the issues in these two questions: <a href="https://stackoverflow.com/questions/30594004/resize-swingnode-in-pane">Resize SwingNode in Pane</a> and <a href="https://stackoverflow.com/questions/20350890/how-to-resize-swing-control-which-is-inside-swingnode-in-javafx8">How to resize Swing control which is inside SwingNode in JavaFX8?</a> Neither of whose answers proved helpful to me, but maybe the answer I found will help someone else in the future. </p>
  
  <hr>
  
  <p>I have a <code>JTable</code> inside a <code>JScrollPane</code> and I need to embed it into a javafx application. I am trying to do this using the <a href="https://github.com/alexbodogit/AnchorFX" rel="noreferrer">AnchorFX docking framework</a>. I also need this SwingNode to somehow be inside a <code>Control</code> (the two I have tried are <code>ScrollPane</code> and <code>SplitPane</code>) so that I can add a <code>ContextMenu</code> to it which is consistent with the rest of the application. </p>
  
  <p>The problem is, when I 'dock' and 'undock' tabs or simply resize the window or the panes inside the window, the <code>JScrollPane</code> with the table in it does not resize properly.</p>
  
  <p>I have modified one of the demos from the AnchorFX project to show my problem:</p>
  
  <pre><code>public class AnchorFX_substations extends Application {
  
  @Override
  public void start(Stage primaryStage) {
  
      DockStation station = AnchorageSystem.createStation();
  
      Scene scene = new Scene(station,  1024, 768);
  
      DockNode node1 = AnchorageSystem.createDock("Node", generateJTableNode());
      node1.dock(station, DockNode.DockPosition.CENTER);
  
      DockNode subNode = AnchorageSystem.createDock("subNode 1", generateJTableNode());
      subNode.dock(station, DockNode.DockPosition.LEFT);
      subNode.floatableProperty().set(false);
  
      DockNode subNode2 = AnchorageSystem.createDock("subNode 2", generateJTableNode());
      subNode2.dock(station, DockNode.DockPosition.LEFT);
  
      AnchorageSystem.installDefaultStyle();
  
      primaryStage.setTitle("AnchorFX SubStation");
      primaryStage.setScene(scene);
      primaryStage.show();
  }
  
  private Control generateJTableNode() {
      ScrollPane contextMenuPane = new ScrollPane();
      SwingNode swingNode = new SwingNode();
      DefaultTableModel model = new DefaultTableModel(); 
      JTable table = new JTable(model); 
  
      // Create a couple of columns 
      model.addColumn("Col1"); 
      model.addColumn("Col2"); 
  
      // Append a row 
      for(int i = 0; i &lt; 200; i++) {
          model.addRow(new Object[]{"col 1 row " + i, "col 2 row "+i});
      }
      JScrollPane scrollPane = new JScrollPane(table);
      swingNode.setContent(scrollPane);
      contextMenuPane.setFitToHeight(true);
      contextMenuPane.setFitToWidth(true);
      contextMenuPane.setContent(swingNode);
      return contextMenuPane;
  }
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) {
      launch(args);
  }
  
  }
  </code></pre>