Resize newly added child into parent in JAVAFX [duplicate]












1
















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













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();
}
);
});
});
Nov 19 '18 at 11:59


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
















    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













    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();
    }
    );
    });
    });
    Nov 19 '18 at 11:59


    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












      1








      1









      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















      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













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 '18 at 11:00









      Antonio HinojosAntonio Hinojos

      62




      62




      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();
      }
      );
      });
      });
      Nov 19 '18 at 11:59


      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();
      }
      );
      });
      });
      Nov 19 '18 at 11:59


      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


















          0














          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
























          • 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
            Nov 19 '18 at 11:13


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          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
























          • 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
            Nov 19 '18 at 11:13
















          0














          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
























          • 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
            Nov 19 '18 at 11:13














          0












          0








          0







          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













          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












          share|improve this answer



          share|improve this answer










          answered Nov 19 '18 at 11:09









          Antonio HinojosAntonio Hinojos

          62




          62













          • 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
            Nov 19 '18 at 11:13



















          • 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
            Nov 19 '18 at 11:13

















          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
          Nov 19 '18 at 11:13





          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
          Nov 19 '18 at 11:13



          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents