Skip to content
astronomizestudios edited this page Jun 18, 2019 · 1 revision

Using the ServerUi API

Adding a Button

ServerGui.addButton(Plugin p, JButton b);

In your onEnable() function in your plugin class, add this, replacing 'Plugin p' with a plugin, and 'JButton b' with a jbutton, like this:

JButton button = new JButton("Example Button")
// add button functionality here

// add the button to the GUI
ServerGui.addButton(this, button);

Of course, you can edit any of the values of the button before adding it to ServerGui!

Clone this wiki locally