setToolTipText

setToolTipText() : ¬†SpecifIc text will be displayed when the mouse will pass over Swing Components. Program       Program Source import javax.swing.JFrame; import javax.swing.JLabel; import java.awt.FlowLayout; class Frame extends JFrame{ Frame() { setTitle(“setToolTipText”); setLayout(new FlowLayout()); setLabel(); setSize(700, 200); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } private void setLabel() { JLabel jl = new JLabel(“JLabel”); jl.setToolTipText(“This is JLabel”); add(jl); … Read more…