Java Swing. For example, there was a rectangular button, you need to make a round. Can I redraw an existing rectangular button or do I need to create two buttons and make them visible alternately? Need any tips.

  • will have to implement your JButton class - woland
  • @woland, I have a class for creating a round button. I need to create 2 objects and change their visibility when hovering ??? Are you talking about this? - dayz2dayz
  • I meant something like this: we add a handler for the mouse movement event, in which we redraw the round button; When the cursor is outside of the button, we redraw it back. - woland
  • @woland, but can something more detailed how exactly this redrawing is done? I cannot understand this. Maybe where there is an example. You can describe the sequence of actions (algorithm). - dayz2dayz

0