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

10 Replies
⌛ This post has been reserved for your question.
Hey @Lloyd_159! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton 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.
💤 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.Do you have a high-dpi screen?
maybe try vector graphics
I don't think so, it's 142.12 if I calculated correctly
ah yeah so 150% zoom probably
That's an annoying dpi to have icons for
JavaFX for example supports 2x and 3x images
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
I don't immediately know, my guess is try to use something like fontawesome or equivalent to have "font" based icons
I just tried, it's also not rly perfect but at least a little better so I'll go with that, thx
np
💤 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.