Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

line break in chart object's tooltip
 Post subject: line break in chart object's tooltip Post rating: 0   New post Posted: Mon 05 Aug, 2013, 21:20 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Is it possible to have a line break in a chart object's tooltip?

I tried something like this, without success:
label.setTooltip("test\n"+"this is a sample tooltip");


Or a tooltip by definition cannot be split into multiple lines?


 
 Post subject: Re: line break in chart object's tooltip Post rating: 0   New post Posted: Tue 06 Aug, 2013, 07:02 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
tcsabina wrote:
Is it possible to have a line break in a chart object's tooltip?
No it is not. The platform uses the standard java swing tooltip which is single-line only.


 
 Post subject: Re: line break in chart object's tooltip Post rating: 0   New post Posted: Tue 06 Aug, 2013, 12:00 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
How about
label.setTooltip("<html>"
+ "Line One"
+ "<br>"
+ "Line 2"
+ "</html>");

or
label.setTooltip("<html><p width=\"500\">" +value+"</p></html>");

If this is a Swing tooltip, the above ones should be valid, right?

I cannot test it right away, that is why I ask for confirmation.


 
 Post subject: Re: line break in chart object's tooltip Post rating: 0   New post Posted: Tue 06 Aug, 2013, 12:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You should be able to do with the JForex-API tooltip all actions which are available with the standard swing tooltip. For testing the standard swing functionality, please consider using "sandbox" programs which don't use the JForex-API.


 
 Post subject: Re: line break in chart object's tooltip Post rating: 0   New post Posted: Wed 07 Aug, 2013, 22:15 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Just for someone else who might be interested in this.
label.setTooltip("<html><p width=\"500\">" +value+"</p></html>");

works perfectly.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com