3 Replies Latest reply: Jun 6, 2011 11:02 AM by 854072 RSS

    Layouts are not working

    854072
      Hi,

      I have a HBox containing two VBox: variables leftside and rightside. Both with layoutinfo { hfill: true hgrow: Priority.ALWAYS } just in case.
      If at runtime I set one to visible = false or even to null, the other one doesn't grow to fill the space left by the other.
      I wanned then to repaint, relayout or something like that manually, trying some of the methods in the classes like layout() or requestLayout() (which I don't get what they do) but nothing changed.

      Also tried resizeNode(node:Node, width:Number, height:Number):Boolean which says return true on success but return true and do nothing.

      Are they some kind of broken? how can I hide elements at runtime without losing automatic layout?

      By the way, my goal is a bit higher. I want to perform this, but smoothly. I mean, one panel visually shrinking while the other is growing, like a scale transition.

      I suppose JavaFX should support this kind of things.

      Thanks...

      Edited by: 851069 on Jun 2, 2011 9:31 PM
        • 1. Re: Layouts are not working
          jojorabbit
          Hi,
          read this blog posts maybe they will help you more:

          http://amyfowlersblog.wordpress.com/2010/04/30/javafx-1-3-taming-the-layout-beast/
          http://amyfowlersblog.wordpress.com/2010/05/26/javafx-1-3-growing-shrinking-and-filling/
          http://amyfowlersblog.wordpress.com/2010/05/07/javafx-1-3-autosizing-everywhere/

          Hope it helps.
          • 2. Re: Layouts are not working
            shakir.gusaroff
            Instead of hiding node or setVisible(false) you can set layoutX or layoutY to negative value using animation.
            talizmelf wrote:
            By the way, my goal is a bit higher. I want to perform this, but smoothly. I mean, one panel visually shrinking while the other is growing, like a scale transition.

            I suppose JavaFX should support this kind of things.
            In Flex you can do it using application state that is supported by the API. It would be good to have something similar in Javafx.

            Edited by: shakir.gusaroff on Jun 6, 2011 8:54 AM
            • 3. Re: Layouts are not working
              854072
              It doesn't matter now. All of this have been removed for javafx 2.0..

              Thanks anyway.