Button - maliut/mgui GitHub Wiki

Create a button by following methods:

// button with the panel it's on, it's x, y, width, height, the text on the button, and the style
// as button is usually defined in panel, the first parameter usually use 'this'
Button btn1 = new Button(this, x, y, width, height, "button", style);

// you don't need to set the text, as it's usually do with an image button. Image is set in the style
Button btn2 = new Button(this, x, y, width, height, style);

// you can also set the text but without style, in this case we consider you want to create a text button,
// so we use Style.EMPTY by default, so it looks like the button style using Swing
Button btn3 = new Button(this, x, y, width, height, "button");

Special note that the parameter x, y, width, height can be between 0 ~ 1. The parameter will then use as a proportion basing on the parent panel's size.