tags:

views:

28

answers:

1

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:

  1. 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.

  2. 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?

  3. Any other suggestions for good design practices?

+2  A: 
  1. 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.

- Common UI would be two buttons, both visible, one disabled. Toggle enabled as needed.

  1. 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?

- Use panels. Add the controls to the panels, show hide the panels as required. I would use something like SpringLayout or FormLayout or a combination on the panels.

  1. Any other suggestions for good design practices?

- Use what feels natural. Do a hallway usability test after prototyping.

Chris Kannon