package org.kodejava.swing;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
import java.awt.FlowLayout;
public class ToolTipExample {
public static void main(String[] args) {
JFrame frame = new JFrame("Tool Tip Demo");
frame.setSize(500, 500);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JLabel label = new JLabel("Hover on me!");
// Setting tool tip for our Swing JLabel component
label.setToolTipText("My JLabel Tool Tip");
frame.getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER));
frame.getContentPane().add(label);
frame.setVisible(true);
}
}
Latest posts by Wayan (see all)
- How do I create a table with multiple header in iText 8? - March 16, 2024
- How do I add Image to a Table in iText 8? - March 11, 2024
- How do I downgrade Android SDK emulator version? - February 12, 2024