0

When I click on the button it shows the icon and after it disappears. How do I keep the icon stay on the button after I clicked it?

It's for my minesweeper BTW.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • Can you add your code or show us a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) of the problem? What about the `pressedIcon` doesn't work when you click it? Also, look over the [Help Center](http://stackoverflow.com/help) and try to improve your question will help us to provide an answer. – chickity china chinese chicken Sep 10 '18 at 18:00
  • I mean when I click the button the icon is there and right after I raise my index finger the icon disappears. But if I hold it the icon is still in there. – isuckatprogramming Sep 10 '18 at 18:06
  • As @davedwards suggested, post a MCVE as an [edit] to the question. One way to get image(s) for an example is to hot link to images seen in [this Q&A](http://stackoverflow.com/q/19209650/418556). E.G. [This answer](https://stackoverflow.com/a/10862262/418556) hot links to an image embedded in [this question](https://stackoverflow.com/q/10861852/418556). – Andrew Thompson Sep 10 '18 at 23:32
  • @isuckatprogramming, I would suggest using [toggle button](https://docs.oracle.com/javase/7/docs/api/javax/swing/JToggleButton.html) –  Sep 10 '18 at 23:41

0 Answers0