Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package outropacote;
- import java.awt.FlowLayout;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.SwingConstants;
- import javax.swing.Icon;
- import javax.swing.ImageIcon;
- public class LabelFrame extends JFrame {
- private JLabel label1;
- private JLabel label2;
- private JLabel label3;
- public LabelFrame() {
- super("Testing JLabel");
- setLayout(new FlowLayout());
- label1 = new JLabel("LAIBEL WIT TECST");
- label1.setToolTipText("This is a sei la man");
- add(label1);
- Icon bug = new ImageIcon(getClass().getResource("hehehehehhe.png"));
- label2 = new JLabel("O bagulho com texto e icone", bug, SwingConstants.LEFT);
- label2.setToolTipText("This is algo2");
- add(label2);
- label3 = new JLabel();
- label3.setText("Label with icon and texto no butao");
- label3.setIcon(bug);
- label3.setHorizontalTextPosition(SwingConstants.CENTER);
- label3.setVerticalTextPosition(SwingConstants.BOTTOM);
- label3.setToolTipText("This is hcha");
- add(label3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement