Well you’re always multiplying the alpha of the image by 1 in your button callback so it will stay the same. If you want it to appear/disappear, a better method might be to place your image in an ImageComponent and then call setVisible (true) or setVisible (false) in the button callback depending on whether you want it visible or not.
Excuse me I have used alpha 1 but it would be 0…
And nothing happens.
I’m having troubles with ImageComponent anyway.
How do I use RectanglePlacemen?
(If you could make a n example plz)
Sure, but if you’ve mutiplied your alpha channel by 0 once then multiplying by 1 will have no effect.
Use ImageComponent like you would any other Component - add it to your window using addAndMakeVisible() and give it a size using setBounds() - but also pass it the Image object you want it to display using the setImage() method. The RectanglePlacement argument is optional but just allows you to justify the image a certain way within the ImageComponent such as aligning it with an edge or stretching it to fit.