In Codename One, I need a class MyButton that extends Button. I want that every myButton instance is a Button which width and height are always equal (to the maximum of their values).
I know that every Component has setWidth and setHeight methods, but they are for the use of the layouts, I suppose that I should not use them directly.
I also know that I can create a Container with a custom layout and place a Button inside it... but in that case I’m not extending the Button class.
My question is if I can extend Button to create square buttons, or if the use of a Container with a custom layout is the only option.