Answer the question
In order to leave comments, you need to log in
Why are icons displayed in poor quality in Javafx?
I am writing an application in JavaFx, I added icons to the HBox, which is located in the AnchorPane, I do all this in the Scene Builder
. The icons are displayed as if in poor quality. Pixels are visible. Icons in png, 500x500
Resolution 500x500:
I add icons via CSS:
.icon-image-pref {
-fx-background-color: transparent;
-fx-background-size: 80% 55%;
-fx-background-repeat: no-repeat;
-fx-background-position: center;
}
.btnPalette {
-fx-background-image: url('resources/palette.png');
}
.btnFonts {
-fx-background-image: url('resources/fonts.png');
}
.btnQuestCards {
-fx-background-image: url('resources/questcards.png');
}
.btnNonQuestCards {
-fx-background-image: url('resources/non-quest-cards.png');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question