0

Following is the standard layout when the application is started: enter image description here And it looks like the following image, as soon as I "zoom" (resize bigger) the pane (which I colored green so you can see it better): enter image description here

How can I draw the pane, which is in the second half of an HBox below all the other children?
For reference here the Nodes in the Scene Builder:
enter image description here

I tried moving the pane with Node.toFront and Node.toBack but didn't see any changes. I tried using the z-scale but this did also not work

Florian
  • 21
  • 5
  • 1
    Try using a StackPane instead. – DaveB Jun 23 '23 at 13:21
  • 1
    Like `toFront()`, `toBack()` "has no effect if this `Node` is not part of a group." `Pane` "may be resized beyond its preferred size to fill whatever space is assigned to it." – trashgod Jun 23 '23 at 13:31
  • 1
    This looks like it may be a layout issue. Can you post your `FXML`? Also, I would make the green pane a `ScrollPane` and make the zoom happen within the `ScrollPane`. – SedJ601 Jun 23 '23 at 14:21
  • https://stackoverflow.com/questions/16680295/javafx-correct-scaling – SedJ601 Jun 23 '23 at 14:25
  • https://stackoverflow.com/questions/39827911/javafx-8-scaling-zooming-scrollpane-relative-to-mouse-position/44314455#44314455 – SedJ601 Jun 23 '23 at 14:26
  • 1
    Hard to advise here without a [mcve]. Perhaps you want a [clip](https://openjfx.io/javadoc/17/javafx.graphics/javafx/scene/Node.html#clipProperty()), or a [ScrollPane](https://openjfx.io/javadoc/17/javafx.controls/javafx/scene/control/ScrollPane.html) or a [SubScene](https://openjfx.io/javadoc/17/javafx.graphics/javafx/scene/SubScene.html) or a [StackPane](https://openjfx.io/javadoc/17/javafx.graphics/javafx/scene/layout/StackPane.html) or to manipulate the [viewOrder](https://openjfx.io/javadoc/17/javafx.graphics/javafx/scene/Node.html#viewOrderProperty) of your nodes. – jewelsea Jun 23 '23 at 17:24
  • "*I tried using the z-scale*" -> z-order (via node z coordinates) won't work without enabling [depthBuffer in your scene](https://openjfx.io/javadoc/17/javafx.graphics/javafx/scene/Scene.html#%3Cinit%3E(javafx.scene.Parent,double,double,boolean,javafx.scene.SceneAntialiasing)), setting correct z values, ensuring that [depth testing is switched on for the relevant nodes](https://openjfx.io/javadoc/17/javafx.graphics/javafx/scene/Node.html#depthTestProperty()) and ConditionalFeature.SCENE3D is avail. As previously noted, there are probably other ways to achieve your aim rather than enabling 3D. – jewelsea Jun 23 '23 at 21:38
  • 1
    *"I tried moving the pane with Node.toFront and Node.toBack but didn't see any change"* -> If you read the doc for these functions: "This is accomplished by moving this Node to the first position in its parent's content ObservableList. This function has no effect if this Node is not part of a group.". So if you made a pane the last element of a hbox and called toBack() on the pane, it will become the first element (left to right) in the hbox, which isn't what you want. – jewelsea Jun 23 '23 at 22:05

0 Answers0