javafx how to set center position for text or label?
-
How to set centerX and centerY for Text or Label node in JavaFX? AFAIK, there is no specific property (or method) for center position, but there are setLayoutX, setLayoutY methods + relocate, which I can't understand how they work.
-
Answer:
You have to tell to your parent layout how to display children. Not children how to display themself. For example if your button is inside an Hbox just do : hbox.setAlignment(Pos.CENTER) You should read https://docs.oracle.com/javafx/2/layout/size_align.htm for a better understanding
kikio at Stack Overflow Visit the source
Related Q & A:
- How to build a basic rich text editor?Best solution by Stack Overflow
- how to change the position of item inside the listview dynamicly in android?Best solution by Stack Overflow
- How do I center my Friendster profile?Best solution by freecodesource.com
- How to send a demo to a record label?Best solution by Yahoo! Answers
- How to get an internship at a record label?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.