A small example of Java button tooltip

Source: Internet
Author: User
Jbutton btnhelptrain = new jbutton ("") {Private Static final long serialversionuid = 4152821268120579799l; Public jtooltip createconltip () {jtooltip tip = super. createconltip (); // multilineconltip tip = new multilineconltip (); tip. setbackground (new color (0 xfffacd); tip. setforeground (color. red); Return tip;} public Boolean contains (int x, int y) {If (x <100) {// settooltiptext ("got green eggs? ");} Else {// settooltiptext (" got ham? ");} Return Super. contains (x, y);}/** public point gettooltiplocation (mouseevent event) {return New * point (event. getx () + 100), (event. gety () + 100);} */}; btnhelptrain. settooltiptext ("<HTML> 10 fields, respectively <br>" + "1, departure date <br>" + "2, the vehicle number format is 55366k13700 <br> "+" 3. vehicle number <br> "+" 4. Departure station code, for example, SNH <br> "+" 5, the arrival station code is CSQ <br> "+" 6. The departure time is <br> "+" 7. The arrival time is <br> "+" 8, the departure site name is in the south of Shanghai <br> "+" 9, and the arrival site name is in the west of Beijing <br> "+" 10. The arrival time format is, indicating 14 hours and 11 minutes 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.