wood burning stoves 2.0*
The moose likes JavaFX and the fly likes public static final int in javafx Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "public static final int in javafx" Watch "public static final int in javafx" New topic
Author

public static final int in javafx

Fabricio Sanchez
Ranch Hand

Joined: Mar 11, 2003
Posts: 33
Hi there,

I can't find a way in javafx to use public static final int variables.
Can anyone tell me the official way to do this (or a work around)?

Example in java:


javaFx attempted code:


However the above doesn't work. I'm guessing because maybe I'm trying to access a value before the object has been initialised.

Any help greatly appreciated.

Best regards,

Fabricio
Fabricio Sanchez
Ranch Hand

Joined: Mar 11, 2003
Posts: 33
I think I found my own solution.
Declare the variables outside the public class .. { .. }
So, in my case:



After that, I could access them just the same as public static final ints in java.

Hope this helps someone else.

Cheers,

Fabricio
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: public static final int in javafx
 
Similar Threads
Generics.
need help on funny switch case logic
Insider's Guide to Mixing Swing and JavaFX
Change the Tick Label Value of X Axis in Java FX
JavaFX vs H.264 on Linux