To drop a shadow, this code sets a contrast color and uses an additional drawString method with offset coordinates:
import javafx.gui.*;
import javafx.gui.effect.*;
Group {
content: [
Rectangle{x: 10 y: 10 width: 200 height: 50 arcHeight:15 arcWidth:15 fill: Color.web("#C0C0C0")},
Text {font: Font{name: "Serif" size: 20, style: FontStyle.BOLD}
x: 110 y: 40 content: "GUI Toolkit" fill: Color.web("#FFFF00")
horizontalAlignment: HorizontalAlignment.CENTER
effect: DropShadow {offsetX: 2 offsetY: -2 radius: 6 color: Color.web("#808080")}}
]
}
This code sample is from Using JavaFX GUI Toolkit