Close

Adding a UI Button

A project log for Barnabas Robotics ArduBlock Upgrade

An upgrade for ArduBlock

NateNate 07/26/2019 at 01:590 Comments

To add a physical UI button that has no function, there are two files to be edited. 

- OpenBlocksFrame.java

- ardublock.properties

OpenBlocksFrame.java must be edited in two places. The first adds your button as a JButton while also calling ardublock.properties to obtain the text that will appear on the button. The second adds it to "buttons" which is a location on the JPanel. 

ardublock.properties simply defines visible text.

The current objective is to add a button that will change the board type. To do this, a new listener must be added which will be called by OpenBlocksFrame.java and run its task. The other listeners call functions in OpenBlocksFrame.java and all run without seeming to communicate with arduino. They appear self sufficient with just ardublock.

Discussions