Advertisement
Guest User

Untitled

a guest
May 28th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 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.     JFrame k = new JFrame();
  20.    
  21.     JLabel k1 = new JLabel("Góra");
  22.     JLabel k2 = new JLabel("Dolna");
  23.     JLabel k3 = new JLabel("Lewa");
  24.     JLabel k4 = new JLabel("Prawa");
  25.     JLabel k5 = new JLabel("Srodek");
  26.    
  27.     k1.setBackground(Color.BLACK);
  28.     k1.setForeground(Color.BLUE);
  29.     k1.setFont(new Font(Font.MONOSPACED,Font.BOLD,10));
  30.     k1.setToolTipText("pierwsza");
  31.     k1.setBorder(BorderFactory.createLineBorder(Color.PINK));
  32.     k1.add(k1,BorderLayout.WEST);
  33.    
  34.     k2.setBackground(Color.WHITE);
  35.     k2.setForeground(Color.PINK);
  36.     k2.setFont(new Font(Font.MONOSPACED,Font.BOLD,12));
  37.     k2.setToolTipText("druga");
  38.     k2.setBorder(BorderFactory.createMatteBorder(5, 10, 5, 15, Color.BLUE));
  39.     k2.add(k2,BorderLayout.NORTH);
  40.    
  41.     k3.setBackground(Color.BLUE);
  42.     k3.setForeground(Color.WHITE);
  43.     k3.setFont(new Font(Font.MONOSPACED,Font.BOLD,14));
  44.     k3.setToolTipText("trzecia");
  45.     k3.setBorder(BorderFactory.createEtchedBorder(Color.RED, Color.GREEN));
  46.     k3.add(k3,BorderLayout.EAST);
  47.    
  48.     k4.setBackground(Color.WHITE);
  49.     k4.setForeground(Color.BLACK);
  50.     k4.setFont(new Font(Font.MONOSPACED,Font.BOLD,16));
  51.     k4.setToolTipText("czwarta");
  52.     k4.setBorder(BorderFactory.createTitledBorder("Tytuł"));
  53.     k4.add(k4,BorderLayout.SOUTH);
  54.    
  55.     k5.setBackground(Color.YELLOW);
  56.     k5.setForeground(Color.GREEN);
  57.     k5.setFont(new Font(Font.MONOSPACED,Font.BOLD,18));
  58.     k5.setToolTipText("piata");
  59.     k5.setBorder(BorderFactory.createEmptyBorder());
  60.     k5.add(k5,BorderLayout.CENTER);
  61.    
  62.     k.pack();
  63.     k.setVisible(true);
  64.     k.setLocationRelativeTo(null);
  65.     k.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  66.    
  67.    
  68.    
  69.   }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement