Resize newly added child into parent in JAVAFX [duplicate]











up vote
1
down vote

favorite













This question already has an answer here:




  • Java Fx resizing scene to stage

    1 answer




Good night, I've run into a problem where I have an application form that I created, the main Stage has buttons to load different fxml into the app, which then are added into a secondary anchorPane, the problem is that these newly added child anchorPanes are not auto-resizing, even after playing around with the Layout Constrains.



I'm using Java 8 and IntelliJ / SceneBuilder



Main Stage Controller:
main_stage_controller



App running in default size:
app_1



App after resizing:
app_2



I have searched everywhere and can't seem to find a solution, thanks!










share|improve this question







New contributor




Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by fabian java
Users with the  java badge can single-handedly close java questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















    up vote
    1
    down vote

    favorite













    This question already has an answer here:




    • Java Fx resizing scene to stage

      1 answer




    Good night, I've run into a problem where I have an application form that I created, the main Stage has buttons to load different fxml into the app, which then are added into a secondary anchorPane, the problem is that these newly added child anchorPanes are not auto-resizing, even after playing around with the Layout Constrains.



    I'm using Java 8 and IntelliJ / SceneBuilder



    Main Stage Controller:
    main_stage_controller



    App running in default size:
    app_1



    App after resizing:
    app_2



    I have searched everywhere and can't seem to find a solution, thanks!










    share|improve this question







    New contributor




    Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    marked as duplicate by fabian java
    Users with the  java badge can single-handedly close java questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    2 days ago


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite












      This question already has an answer here:




      • Java Fx resizing scene to stage

        1 answer




      Good night, I've run into a problem where I have an application form that I created, the main Stage has buttons to load different fxml into the app, which then are added into a secondary anchorPane, the problem is that these newly added child anchorPanes are not auto-resizing, even after playing around with the Layout Constrains.



      I'm using Java 8 and IntelliJ / SceneBuilder



      Main Stage Controller:
      main_stage_controller



      App running in default size:
      app_1



      App after resizing:
      app_2



      I have searched everywhere and can't seem to find a solution, thanks!










      share|improve this question







      New contributor




      Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      This question already has an answer here:




      • Java Fx resizing scene to stage

        1 answer




      Good night, I've run into a problem where I have an application form that I created, the main Stage has buttons to load different fxml into the app, which then are added into a secondary anchorPane, the problem is that these newly added child anchorPanes are not auto-resizing, even after playing around with the Layout Constrains.



      I'm using Java 8 and IntelliJ / SceneBuilder



      Main Stage Controller:
      main_stage_controller



      App running in default size:
      app_1



      App after resizing:
      app_2



      I have searched everywhere and can't seem to find a solution, thanks!





      This question already has an answer here:




      • Java Fx resizing scene to stage

        1 answer








      java javafx layout responsive autosize






      share|improve this question







      New contributor




      Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 days ago









      Antonio Hinojos

      62




      62




      New contributor




      Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      marked as duplicate by fabian java
      Users with the  java badge can single-handedly close java questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      2 days ago


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by fabian java
      Users with the  java badge can single-handedly close java questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      2 days ago


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Adding the following lines to the child FXML loaded pane fixed it:



          AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"


          Now the app resizes and centers the newly loaded anchorPanes.






          share|improve this answer








          New contributor




          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • SceneBuilder treated the fxml as standalone scenes, not children anchors. hard-coding the layout constraint doesn't seem to cause any problems in the app nor the editor.
            – Antonio Hinojos
            2 days ago


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          Adding the following lines to the child FXML loaded pane fixed it:



          AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"


          Now the app resizes and centers the newly loaded anchorPanes.






          share|improve this answer








          New contributor




          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • SceneBuilder treated the fxml as standalone scenes, not children anchors. hard-coding the layout constraint doesn't seem to cause any problems in the app nor the editor.
            – Antonio Hinojos
            2 days ago















          up vote
          0
          down vote













          Adding the following lines to the child FXML loaded pane fixed it:



          AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"


          Now the app resizes and centers the newly loaded anchorPanes.






          share|improve this answer








          New contributor




          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • SceneBuilder treated the fxml as standalone scenes, not children anchors. hard-coding the layout constraint doesn't seem to cause any problems in the app nor the editor.
            – Antonio Hinojos
            2 days ago













          up vote
          0
          down vote










          up vote
          0
          down vote









          Adding the following lines to the child FXML loaded pane fixed it:



          AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"


          Now the app resizes and centers the newly loaded anchorPanes.






          share|improve this answer








          New contributor




          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          Adding the following lines to the child FXML loaded pane fixed it:



          AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"


          Now the app resizes and centers the newly loaded anchorPanes.







          share|improve this answer








          New contributor




          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer






          New contributor




          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered 2 days ago









          Antonio Hinojos

          62




          62




          New contributor




          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Antonio Hinojos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.












          • SceneBuilder treated the fxml as standalone scenes, not children anchors. hard-coding the layout constraint doesn't seem to cause any problems in the app nor the editor.
            – Antonio Hinojos
            2 days ago


















          • SceneBuilder treated the fxml as standalone scenes, not children anchors. hard-coding the layout constraint doesn't seem to cause any problems in the app nor the editor.
            – Antonio Hinojos
            2 days ago
















          SceneBuilder treated the fxml as standalone scenes, not children anchors. hard-coding the layout constraint doesn't seem to cause any problems in the app nor the editor.
          – Antonio Hinojos
          2 days ago




          SceneBuilder treated the fxml as standalone scenes, not children anchors. hard-coding the layout constraint doesn't seem to cause any problems in the app nor the editor.
          – Antonio Hinojos
          2 days ago



          Popular posts from this blog

          Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

          Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

          A Topological Invariant for $pi_3(U(n))$