In our recent work with some customers, we have had some comments that they would like the User to be able to get visual feedback when the mouse is hovered over certain component types.
The feedback is typically by drawing a special border around the component. For example:
When the user’s mouse hovers over a TextField or TextArea, we might paint a bold translucent green border around the component. Then, when the user clicks inside the the Text component, the border might change to a deep blue color. When the user moves the foucus to another component, the border returns to its original form.
We can do the same for Buttons and other Swing components by some configuration we could wrap into a plugin.
Before we do that, I’d just like to determine the level of interest in such a feature and if there are any additional features that might be desirable along these lines.
Can the colour/effect be programmed - ie green border for an editable field, blue border if the field can be clicked to trigger a popup, and yellow for a button. If this worked consistantly x-plat would be very useful.
That (ugly) scenario would give you a blue button border when the user waved the mouse across the top of any JButton; any JButton that was clicked would have the background color changed to white and the border changed to red during the de-press.
Once the user had finished the click and moved the mouse away, then the default settings would be re-applied to the JButton.
ie green border for an editable field, blue border if the field can be clicked to trigger a popup, and yellow for a button.
If this worked consistantly x-plat would be very useful.
Absolutely. The matrix would cover attributes such as Editable or PopupEnabled, so that you could select the effect to apply to JTextFields (and virtually all JComponents).
So, if the user hovers (and I think the hover feedback is the important action to focus on), then the border (or background if that’s the attribute you choose to set) would change color to green for a ‘plain editable field’, to blue if the textfield had a popup added to it.
The matrix would be something you could configure via methods or via a User Interface dedicated to the task.
One way to do this is using the ToolTip property on such an element. The tooltip can use HTML so you can build a whole webpage in a tooltip if you want.
And tooltips can be set on the fly by code as well.
I had an inkling someone was going to say that when I was exploring tooltips, thanks for the confirmation.
Can tooltip html include JavaScript / references to .js files? If so, what’s the root folder I need to put files in both when testing, and when hosted?
Just like labels and the HTML_AREA field the tooltip uses the Sun HTML render engine which doesn’t support javascript inside the HTML.
So there is support for mouse-overs and other DHTML.