Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I'm exploring javafx now and I'm confuse about the setting the scene with predefine height and width.
I'm just wondering what is the unit of measurement used here?

Java
Scene(Parent root, double width, double height)


What I have tried:

according to docs there is a constructor where you can you set the height and width
Java
Scene(Parent root, double width, double height)

I'm confused it's on double, is it mm, cm, pixel?
Posted
Updated 20-Apr-21 21:55pm
Comments
Richard MacCutchan 21-Apr-21 3:53am    
most likely it is pixels; a simple test should confirm.

There is no unit of measurement. It's whatever you want it to be. Everything works out so long as you are consistent with your use of values and scaling.
 
Share this answer
 
Comments
lelouch_vi 2 21-Apr-21 0:27am    
Hi Dave Kreskowiak, thanks for answering. I'm still confused though.
I use this
Scene scene = new Scene(root,320,320);
it creates a window with a scene that looks square. My question is the 320 that I passed inside the constructor is based on what?
Dave Kreskowiak 21-Apr-21 0:49am    
Nothing! There are no units of measure. It's whatever you want it to be!
lelouch_vi 2 21-Apr-21 0:57am    
Okay, I see. I just thought that there is something that it can be base on because I have just done my HTML and CSS so I thought there is something like that in javafx measurement like base on px, in, cm, mm sort of like that. But anyway thanks! so the measurements will be base on how you use the numbers passed in the constructors.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900