Skip to main content

JavaFX Script constants

3 replies [Last post]
behrangsa
Offline
Joined: 2003-09-14

Hi,

At the moment it looks like JavaFX Script has opted for all-lowercase identifiers for constants, such as "blue", "green", etc.

This makes mixing Java and JavaFX code a little bit ugly and inconsistent. I would recommend making these constants all upper-case, i.e change them to BLUE, GREEN, etc. to make JavaFX Script and Java code more consistent and similar looking.

Best,
Behrang

Message was edited by: behrangsa

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
behrangsa
Offline
Joined: 2003-09-14

Duh!

Looks like I was wrong. Those attributes are RGB values for Color and I also looked at some of the old tutorials I had read and I can't find any references to color constants with lowercase letters. Looks like it's been all part of my imagination!?!?!?!?

Cheers,
Behi

michael_heinrichs
Offline
Joined: 2007-11-15

The convention in JavaFX is to make the identifiers of public constants all uppercase, just like in Java. To which constants are you referring? The colors are all upper-case. If some constants are lowercase, it needs to be fixed.

behrangsa
Offline
Joined: 2003-09-14

Michael,

Thanks. Looks like I was looking at older docs/examples then. For example, in the JavaFX API for Color the constants are lower-case:

https://openjfx.dev.java.net/nonav/api/javafx/ui/Color.html

Also in some blog posts and articles I have seen constanrs as lower-case letters.

Cheers,
Behrang