Items in one sentence about javafx
- Always assume user knows nothing about programming.
- Do not expect user will open user guide. Someone, including me, even will not look at nor think about prompts on the screen.
- Necessary prompts can help user understand intention of the program.
- Ambiguous prompt is worse than no prompt.
- Always response for user, like pop information, make sound, or update interface.
- Provide most options and set default choice.
- Remember user’s inputs or seletions and fill in or set values automatically in next time.
- Less inputs or selections meanwhile keep interfaces clean.
- Use radio or check buttons instead of drop-down list if there is enough place in interface.
- No more than 3 levels to select.
- Try best to intercept inputs which may cause bad results. Examples: Do not support invalid options, check data type or value range, prompt operation's consequences, etc..
- When too many controls in interface, consider popular layout: Left-right areas like curtain, vertical accordion menus, tabs to switch targets
- User’ screen resolution may be from 1k to 4k, so the design size of most MyBox interfaces is smaller than 1100 * 720.
- Make use of auto-wrap container like FlowPane, to work for both small screen and large screen.
- Controls can be updated only in JavaFx thread. Use Platform.runLater to change control when handle event in its listener.
- Progress should be shown when operation costs much time.
- Time-consume operation should not be run in JavaFx thread to avoid blocking interface.
- Backgournd task should always check whether task is canceled, especially in loop or before/after long-run statements.
- When listen mouse events, event.getX() and event.getY() return the coordinate of event.getSource() which is the control owns the events. Example, when listen on ImageView, the coordinate is related to the image.
- Iterative calls may happen when listen both onMouseEntered and onMouseExited and change focus in handling of the events(like pop menu) or change control’s size.
- When double click mouse, single-click event is tiggerred at first and then double-click event is triggerred. So need avoid duplicated or conflicted handlings against same event.
- For table's multiple selections, use getSelectedIndices() to listen changes, Some changes may be missed if use selectedItemProperty().
- For tree, display it after its generation, rather than display it while make the tree items.