Popup messages for validation

折月煮酒 提交于 2019-12-24 09:24:31

问题


I'd like to have some small popup messages appear under text fields to indicate if inputted information is incorrect like on Spring/Eclipse RCP. How can this be achieved?


回答1:


IMO there are at least two ways to achieve that. You can use JGlassPane or JXLayer framework. The basic idea to draw your popup messages on the transparent layer "above" your text fields.

I used the JXLayer framework because I felt it gave me a greater flexibility in what I could do.




回答2:


You should probably take a look at JGoodies Validation open source library. It does what you want and much more. It is probably better than reinventing the wheel.



来源:https://stackoverflow.com/questions/5852941/popup-messages-for-validation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!