简体   繁体   中英

JavaFX How can I set the location/coordinates of a pane?

How can I manually set the coordinates of a pane? When I click an ImageView I want to have a different ImageView popup at the same location, and then scale it up. I can get it to pop up but it only does so in the default top left corner of the parent pane for all the ImageViews.

The short version: use setLayoutX (and Y) or setTranslateX (and Y).

The long version:

It depends on what your parent container is. You should make yourself familiar with Working With Layouts in JavaFX and the Node class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM