Resolution of Images in Swing

Whenever I add ImageIcons to my GUI using swing, they always are kinda pixelated. If I use pngs with higher resolution instead, they also appear bigger, and I can't manage to scale it down while keeping a high resolution. Do I miss anything here? attached is a screenshot from an icon in my gui in 1:1 scale, you easily can see how pixelated it is
No description
10 Replies
JavaBot
JavaBot3mo ago
This post has been reserved for your question.
Hey @Lloyd_159! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
tjoener
tjoener3mo ago
Do you have a high-dpi screen?
ayylmao123xdd
ayylmao123xdd3mo ago
maybe try vector graphics
Lloyd_159
Lloyd_159OP3mo ago
I don't think so, it's 142.12 if I calculated correctly
tjoener
tjoener3mo ago
ah yeah so 150% zoom probably That's an annoying dpi to have icons for JavaFX for example supports 2x and 3x images
Lloyd_159
Lloyd_159OP3mo ago
is there anything I can try to fix it using swing? I build my whole gui using swing and don't rly want to start all over again
tjoener
tjoener3mo ago
I don't immediately know, my guess is try to use something like fontawesome or equivalent to have "font" based icons
Lloyd_159
Lloyd_159OP3mo ago
I just tried, it's also not rly perfect but at least a little better so I'll go with that, thx
tjoener
tjoener3mo ago
np
JavaBot
JavaBot3mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?