Search code examples
javanetbeansjtextpanejeditorpanehint

Generated code preview in netbeans. How to make effect like that?


Some time ago I saw a nice effect in netbeans IDE. When my cursor stops on the Generated Code text (e.g. in generated JFrame), some kind of hint (preview of generated code) is visible (has grey background).
I searched it and I didn't found anything. My question is what is that component and how does it works? I suspect that is specific TextPane/EditorPane or something like that. enter image description here

EDIT:

Yea, this is a JToolTip, and here is some extra info:

http://www.coderanch.com/t/346510/GUI/java/Customizing-JToolTip

Book page: 85


Solution

  • The first one is a JToolTip. The second one seems to be a JToolTip as well, but with formatted code and a different background color, at least from the screenshot you have linked to.