Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. package outropacote;
  2.  
  3. import java.awt.FlowLayout;
  4. import javax.swing.JFrame;
  5. import javax.swing.JLabel;
  6. import javax.swing.SwingConstants;
  7. import javax.swing.Icon;
  8. import javax.swing.ImageIcon;
  9.  
  10. public class LabelFrame extends JFrame {
  11.  
  12. private JLabel label1;
  13. private JLabel label2;
  14. private JLabel label3;
  15.  
  16.  
  17. public LabelFrame() {
  18. super("Testing JLabel");
  19. setLayout(new FlowLayout());
  20.  
  21. label1 = new JLabel("LAIBEL WIT TECST");
  22. label1.setToolTipText("This is a sei la man");
  23. add(label1);
  24.  
  25. Icon bug = new ImageIcon(getClass().getResource("hehehehehhe.png"));
  26. label2 = new JLabel("O bagulho com texto e icone", bug, SwingConstants.LEFT);
  27. label2.setToolTipText("This is algo2");
  28. add(label2);
  29.  
  30. label3 = new JLabel();
  31. label3.setText("Label with icon and texto no butao");
  32. label3.setIcon(bug);
  33. label3.setHorizontalTextPosition(SwingConstants.CENTER);
  34. label3.setVerticalTextPosition(SwingConstants.BOTTOM);
  35. label3.setToolTipText("This is hcha");
  36. add(label3);
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement