Author Topic: CustomToolTips too wide  (Read 3104 times)

subes

  • Full Member
  • ***
  • Posts: 154
    • View Profile
CustomToolTips too wide
« on: February 16, 2012, 09:28:50 AM »
When configuring in default.properties:
Code: [Select]
component.javax.swing.JComponent.customToolTip=true

Then very long tooltip texts are displayed too wide. Would it be possible to limit the horizontal size like Firefox and IE do it automatically?

See attached sample and screenshots.

Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
Re: CustomToolTips too wide
« Reply #1 on: February 21, 2012, 06:57:42 PM »
The goal of custom tooltip is to support HTML (standard HTML tooltips only supports 1 line plain text).

We are trying not to limit tooltip in what it does, so it just layouts HTML it has, that allows you to put tables inside, make it whole screen wide or anything else you want.

Generally using custom tooltip you should provide HTML that layouts the way you want. In your case that means putting <br> in places where you want to break to new line. So you can just take tooltip you have and add more HTML/CSS in it to layout if exactly the way you want.

We understand that you might just want to limit maximum width on all your custom tooltips. Ideally that's done by adding 1 line in your webapps/ajaxswing/Light_docs/css/custom.css:
Code: [Select]
.tooltip {
    max-width: 250px;
}
It's supported by all browser from IE7, but still might not always work, in this case you might need to specify "width" property manually.

subes

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: CustomToolTips too wide
« Reply #2 on: February 22, 2012, 09:05:04 AM »
Thanks, this is working. We now have 500px configured.