mgarin / weblaf

WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
http://weblookandfeel.com
GNU General Public License v3.0
1.13k stars 234 forks source link

custom toolTip #694

Closed wyj3531 closed 1 year ago

wyj3531 commented 2 years ago

image

wyj3531 commented 2 years ago

can i custom its style?Background, WebShape,Line,etc. and how to remove the arrow ,it is also happen in WebComboBox.

mgarin commented 2 years ago

can i custom its style?Background, WebShape,Line,etc.

Unfortunately custom tooltips style is currently not modifiable as it is hardcoded in WebCustomTooltip class. It is listed in #476 and mentioned in #520 for future improvements.


and how to remove the arrow ,it is also happen in WebComboBox.

I recommend using simple Swing tooltips instead of the custom WebLaF ones if you don't want the positioning/arrow style - check the JToolTip section in demo:

image

You can also modify the JToolTip display via its style: https://github.com/mgarin/weblaf/blob/master/modules/ui/src/com/alee/skin/light/resources/tooltip.xml

Unfortunately you can only change it's style globally as there is currently no way to change it on per-component basis. I've added a separate issue for that - #695 - which will be implemented in future versions.

wyj3531 commented 2 years ago

how about this arrow? ![Uploading image.png…]()

wyj3531 commented 2 years ago

image

mgarin commented 2 years ago

Combobox popup menu can be adjusted via style. Combobox style has a child style that is attached to it's popup menu: https://github.com/mgarin/weblaf/blob/master/modules/ui/src/com/alee/skin/light/resources/combobox.xml#L90

You can create a custom style for combobox and adjust the popup style in it:

<style type="combobox" id="custom">
    <style type="popupmenu" id="popup">
        <painter>
            <popupStyle>simple</popupStyle>
        </painter>
    </style>
</style>
wyj3531 commented 1 year ago

.