How to use ToolTip in Java Swing
You can create a tool tip for any JComponent with setToolTipText() method. This method is used to set up a tool tip for the component.
For example, to add tool tip to PasswordField, you need to add only one line of code:
Simple ToolTip Example
Output:
How to change TitleBar icon in Java AWT and Swing
The setIconImage() method of Frame class is used to change the icon of Frame or Window. It changes the icon which is displayed at the left side of Frame or Window.
The Toolkit class is used to get instance of Image class in AWT and Swing.
Toolkit class is the abstract super class of every implementation in the Abstract Window Toolkit(AWT). Subclasses of Toolkit are used to bind various components. It inherits Object class.
Example to change TitleBar icon in Java AWT
Output:
Example to change TitleBar icon in Java Swing
Output:
Comments
Post a Comment