-
Bug
-
Resolution: Unresolved
-
P4
-
jfx19
-
aarch64
-
os_x
ADDITIONAL SYSTEM INFORMATION :
Mac OS 13.1 (22C65)
Java 17
A DESCRIPTION OF THE PROBLEM :
When a png icon to a stage and then adding the same icon to the scene, the icon is has different colors between the stage title bar and the scene content. The colors in the stage title bar are relatively watered down.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a minimal hello world JavaFX App
2. Have a png icon inside the resources folder
3. Add that icon to the stage title bar
4. Add that icon again inside the scene
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The icon should look the same between the stage title bar and the scene
ACTUAL -
It looks different
---------- BEGIN SOURCE ----------
import javafx.application.Application
import javafx.geometry.Pos.TOP_CENTER
import javafx.scene.Scene
import javafx.scene.image.Image
import javafx.scene.image.ImageView
import javafx.scene.layout.VBox
import javafx.stage.Stage
fun main() {
Application.launch(IconColorBug::class.java)
}
class IconColorBug: Application() {
override fun start(primaryStage: Stage?) {
primaryStage!!.apply {
title = "stage title"
val res = ClassLoader.getSystemClassLoader()!!.getResource("logo_32.png")!!.toString()
icons.add(Image(res))
scene = Scene(VBox().apply {
alignment = TOP_CENTER
prefWidth = 300.0
prefHeight = 300.0
children.add(ImageView(Image(res)))
})
}.show()
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I cannot find a workaround
FREQUENCY : always
Mac OS 13.1 (22C65)
Java 17
A DESCRIPTION OF THE PROBLEM :
When a png icon to a stage and then adding the same icon to the scene, the icon is has different colors between the stage title bar and the scene content. The colors in the stage title bar are relatively watered down.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a minimal hello world JavaFX App
2. Have a png icon inside the resources folder
3. Add that icon to the stage title bar
4. Add that icon again inside the scene
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The icon should look the same between the stage title bar and the scene
ACTUAL -
It looks different
---------- BEGIN SOURCE ----------
import javafx.application.Application
import javafx.geometry.Pos.TOP_CENTER
import javafx.scene.Scene
import javafx.scene.image.Image
import javafx.scene.image.ImageView
import javafx.scene.layout.VBox
import javafx.stage.Stage
fun main() {
Application.launch(IconColorBug::class.java)
}
class IconColorBug: Application() {
override fun start(primaryStage: Stage?) {
primaryStage!!.apply {
title = "stage title"
val res = ClassLoader.getSystemClassLoader()!!.getResource("logo_32.png")!!.toString()
icons.add(Image(res))
scene = Scene(VBox().apply {
alignment = TOP_CENTER
prefWidth = 300.0
prefHeight = 300.0
children.add(ImageView(Image(res)))
})
}.show()
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I cannot find a workaround
FREQUENCY : always
- relates to
-
JDK-8204936 [linux] stage.getIcons().add(icon); works sometimes
- Open