Ajp 2 Swings
Ajp 2 Swings
SWINGS
Object java.lang
Component
JComponent
Window
JFrame
import javax.swing.*;
import java.awt.*;
public class JFrameDemo
{
}
Prof. Abhijeet Sir
JLabel
1. JLabel()
Create a empty label having no text and icon
2. Jlabel(String str)
2) ImageIcon(URL url)
JTextField(String s)
public JFrameDemo()
{
setLayout(new FlowLayout());
setSize(400,500);
}
Prof. Abhijeet Sir
JCHECKBOX
A checkbox is a control that may be turned ON or
OFF by the user to indicate some option.
Swing
2) JTabbedPane.SCROLL_TAB_LAYOUT
Wrap Tabbed Policy
• Here, str is the title for the tab, and comp is the
JScrollPane()
JScrollPane(Component comp)
}
Prof. Abhijeet Sir
JToolTip
A tooltip is a textual pop-up that momentarily
appears when the mouse cursor rests inside the
Components painting region
We can add tooltip text to almost all the
components of Java Swing by using the method