问题
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