question: private void createInfoWindow ( ) { infoWindow = new JWindow ( SwingUtilities . getWindowAncestor ( textField ) ) ; infoLabel = new JLabel ( ) ; infoWindow . add ( infoLabel ) ; JPanel contentPane = ( JPanel ) infoWindow . getContentPane ( ) ; Border border = BorderFactory . createCompoundBorder ( BorderFactory . createLineBorder ( Color . GRAY ) , BorderFactory . createEmptyBorder ( 2 , 4 , 2 , 4 ) ) ; contentPane . setBorder ( border ) ; contentPane . setBackground ( HtmlColors . decode ( "#EEEEEE" ) ) ; infoLabel . setFont ( textField . getFont ( ) ) ; containingWindow = SwingUtilities . getWindowAncestor ( textField ) ; if ( containingWindow != null ) { containingWindow . addComponentListener ( componentListener ) ; } textField . addComponentListener ( componentListener ) ; }
target:  Creates the window for the info popup. This should only be run once and then reused, only changing the text and size.