I need to add a simple GUI for running a stress-test. I would like to do something like this:
State 0: stress-test is not in progress -- in this state the user can enter/increment a number in a spinner. Pressing the go button will start the test and transition to state 1.
[spinner] [go button]
State 1: stress-test is in progress -- in this state, the stress test runs, periodically executing a task and decrementing the spinner count each time the task is complete. The spinner is disabled for input. When the stop button is pressed or the spinner count reaches 0, the test stops and transitions to state 0. The progressbar shows what fraction of the # of tasks are complete.
[spinner] [stop button] [progressbar]
I have a few questions:
Is it better for the go/stop buttons to be two separate buttons, where only the go button is visible in state 0, and only the stop button is visible in state 1? Or should I just use 1 button and change the button text and the action listener? I think the two separate buttons approach is better but I'm not sure.
How can I use Javabuilders + MiGLayout to position two separate buttons (go/stop) in the same location, and put the progressbar in a particular location, so that I can show/hide the GUI controls as necessary?
Any other suggestions for good design practices?