Advertisement
Guest User

Untitled

a guest
May 28th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. /**
  2. *
  3. * @author Gostkowski Jakub S12660
  4. *
  5. */
  6.  
  7. package zad1;
  8.  
  9. import java.awt.BorderLayout;
  10. import java.awt.Color;
  11. import java.awt.Font;
  12.  
  13. import javax.swing.BorderFactory;
  14. import javax.swing.JFrame;
  15. import javax.swing.JLabel;
  16.  
  17. public class Main {
  18. public static void main(String[] args) {
  19.  
  20. JFrame k = new JFrame();
  21.  
  22. JLabel k1 = new JLabel("Góra");
  23. JLabel k2 = new JLabel("Dolna");
  24. JLabel k3 = new JLabel("Lewa");
  25. JLabel k4 = new JLabel("Prawa");
  26. JLabel k5 = new JLabel("Srodek");
  27.  
  28. k1.setBackground(Color.BLACK);
  29. k1.setForeground(Color.BLUE);
  30. k1.setFont(new Font(Font.MONOSPACED,Font.BOLD,10));
  31. k1.setToolTipText("pierwsza");
  32. k1.setBorder(BorderFactory.createLineBorder(Color.PINK));
  33. k.add(k1,BorderLayout.WEST);
  34.  
  35. k2.setBackground(Color.WHITE);
  36. k2.setForeground(Color.PINK);
  37. k2.setFont(new Font(Font.MONOSPACED,Font.BOLD,12));
  38. k2.setToolTipText("druga");
  39. k2.setBorder(BorderFactory.createMatteBorder(5, 10, 5, 15, Color.BLUE));
  40. k.add(k2,BorderLayout.NORTH);
  41.  
  42. k3.setBackground(Color.BLUE);
  43. k3.setForeground(Color.WHITE);
  44. k3.setFont(new Font(Font.MONOSPACED,Font.BOLD,14));
  45. k3.setToolTipText("trzecia");
  46. k3.setBorder(BorderFactory.createEtchedBorder(Color.RED, Color.GREEN));
  47. k.add(k3,BorderLayout.EAST);
  48.  
  49. k4.setBackground(Color.WHITE);
  50. k4.setForeground(Color.BLACK);
  51. k4.setFont(new Font(Font.MONOSPACED,Font.BOLD,16));
  52. k4.setToolTipText("czwarta");
  53. k4.setBorder(BorderFactory.createTitledBorder("Tytuł"));
  54. k.add(k4,BorderLayout.SOUTH);
  55.  
  56. k5.setBackground(Color.YELLOW);
  57. k5.setForeground(Color.GREEN);
  58. k5.setFont(new Font(Font.MONOSPACED,Font.BOLD,18));
  59. k5.setToolTipText("piata");
  60. k5.setBorder(BorderFactory.createEmptyBorder());
  61. k.add(k5,BorderLayout.CENTER);
  62.  
  63. k.pack();
  64. k.setVisible(true);
  65. k.setLocationRelativeTo(null);
  66. k.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  67.  
  68.  
  69.  
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement