How to display a temporary baloon tooltip during input validation?

后端 未结 2 1044
感动是毒
感动是毒 2021-02-08 01:58

I\'m somewhat used to the GUI idiom where when I type something wrong in a text input field a balloon pops up from the field with info about what I got wrong / expected input. I

2条回答
  •  囚心锁ツ
    2021-02-08 02:21

    Balloon Tip is a library that does that:

    balloonTip = new BalloonTip(f, "Tooltip msg");
    

    That was all needed! If you insist on a having it be a tooltip too:

    tooltipBalloon = new BalloonTip(someComponent, "I'm a balloon tooltip!");
    // Now convert this balloon tip to a tooltip, such that the tooltip shows up after 500 milliseconds and stays visible for 3000 milliseconds
    ToolTipUtils.balloonToToolTip(tooltipBalloon, 500, 3000);
    

提交回复
热议问题