Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 404853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:20:47+00:00 2026-05-12T17:20:47+00:00

How can I get the actual position of a node in the scene .

  • 0

How can I get the actual position of a node in the scene. The absolute position, regardless of any containers/transforms.

For example, I want to translate a certain node a so that it would temporarily overlap another node b. So I wish to set his translateX property to b.globalX-a.globalX.

The documentation says:

Defines the X coordinate of the
translation that is added to the
transformed coordinates of this Node
for the purpose of layout. Containers
or Groups performing layout will set
this variable relative to
layoutBounds.minX in order to position
the node at the desired layout
location.

For example, if child should have a
final location of finalX:

 child.layoutX = finalX - child.layoutBounds.minX;

That is, the final coordinates of any node should be

finalX = node.layoutX + node.layoutBounds.minX

However running the following code:

var rect;
Stage {
    title: "Application title"
    width: 250
    height:250
    scene: Scene {
        content: [
            Stack{content:[rect = Rectangle { width:10 height:10}] layoutX:10}
        ]
    }
}

println("finalX = {rect.layoutX+rect.layoutBounds.minX}");

gives me finalX = 0.0 instead of finalX = 10.0 as the docs seemingly state.

Is there a clear method to get the absolutely final positioning coordinates in JavaFX?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:20:47+00:00Added an answer on May 12, 2026 at 5:20 pm

    The only solution I found so far is

    rect.localToScene(rect.layoutBounds.minX, rect.layoutBounds.minY) // a Point2D{x:Float y:Float} object
    

    Which doesn’t seem to me as the “best” way to do that (note that this function is not bound). Still it works for JavaFX 1.2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can get the actual position of the cursor in an input field. How
Is there any way I can get the actual row number from a query?
How I can get actual folder path where my program is without my exe
In webspiders/crawlers how can i get the actual initial rendered size of the font
I get this error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 4:
How can I find the absolute position of the paper/canvas when using the Raphael
I'm trying to position two panels and just can't get it to work... I
Possible Duplicate: How to get the actual x/y position of an element in SVG
Can get all triples with value null in specific field? All people with date_of_birth
We can get class Class object by 3 methods: MyClass.class obj.getClass Class.forName(className) I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.