openrocket / openrocket

Model-rocketry aerodynamics and trajectory simulation software
https://openrocket.info/
Other
1.3k stars 407 forks source link

[Feature Request] Use FlatLaf's JComponent.outline for error and warning feedback #2560

Open SiboVG opened 2 months ago

SiboVG commented 2 months ago

Is your feature request related to a problem? Please describe. Currently, when users enter dubious values in input fields, there's no immediate visual feedback to indicate which field is problematic. This can lead to confusion and delays in correcting input errors.

Describe the solution you'd like Implement FlatLaf's JComponent.outline property to render input widgets with an "error" or "warning" look. This can be achieved by calling myComponent.putClientProperty("JComponent.outline", "warning") on the component when a dubious value is entered. This will provide immediate visual feedback to users, highlighting which input field requires attention.

image

Describe alternatives you've considered I haven't explored other alternatives as this solution is already included in FlatLaf by default and seems to be the most straightforward implementation.

SiboVG commented 2 months ago

One example of where to apply this: add a warning to the pressure input field in the simulations edit dialog, when the pressure is really low or high. Or when the launch rod angle is suspicious, or maybe for very high wind speeds...

In any case, this PR should have a generic implementation to add warning/error conditions for components.