I am creating a label editor, which consists of a panel
which is where the label
, these can contain text or images, once created I would like the user to be able to resize them.
I already have the other functions (move it in position, etc.), this is the only function that I am missing but I can't find a way to do it, this is how my program looks:
A good approach is to implement mouse events on the component by identifying which area of the JLabel it is moving into and then 'playing' with the cursor types; I will share with you the core of the code I wrote to change sizes with the mouse.
Logically you can improve the previous snippet by adding, removing and optimizing any feature you see.
You can try a, in the label's constructor, put
setResizable(true);
, by creating a class for the label in question that extends from JLabel.