Reputation: 1
I am working on a small Inventory System
for my university project, I am planning that admin should be able to change the system logo.
The problem is when admin changes the photo, it will be displayed as original size and shape and the whole look get ugly so here is my question.
How can I crop the image into a circle
and 250 x 250
pixel?
P.S. When I first asked this question, I just started learning Java and my English language was not good; so here I am 4 and a half years letter editing my own question completely.
Upvotes: 0
Views: 514
Reputation: 324207
A label is transparent by default.
So either you have non-transparent pixels in your image or the frame itself is not transparent so you see the frame background.
Read the section from the Swing tutorial on How to Create Translucent and Shaped Windows for more information on transparent frames.
Basiclly you need to use a non decorated frame and then use:
frame.setOpacity(0.0);
Upvotes: 2