Advertisement
Guest User

Untitled

a guest
May 24th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. /**
  2.  *
  3.  *  @author Wieczorek Krzysztof S15877
  4.  *
  5.  */
  6.  
  7. package zad3;
  8.  
  9. public class Main {
  10.  
  11.     public static void main(String[] args) {
  12.         new Okno();
  13.     }
  14. }
  15. //-----------------------------------------------------------------------
  16.  
  17. package zad3;
  18.  
  19. import javax.swing.JFrame;
  20. import javax.swing.JPanel;
  21.  
  22. public class Okno extends JFrame {
  23.  
  24.     public Okno() {
  25.         super("Edytor");
  26.  
  27.         JPanel panel = new Edytor();
  28.         add(panel);
  29.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  30.         pack();
  31.         setVisible(true);
  32.     }
  33. }
  34.  
  35.  
  36. //-------------------------------------------------
  37.  
  38. package zad3;
  39.  
  40. import java.awt.Color;
  41. import java.awt.Font;
  42.  
  43. import javax.swing.JPanel;
  44. import javax.swing.JTextArea;
  45.  
  46. public class Edytor extends JPanel {
  47.     public Edytor() {
  48.         super();
  49.         JTextArea list = new JTextArea(10, 20); // edytor
  50.         Font czcionka = new Font("Dialog", Font.ITALIC, 14);
  51.         list.setFont(czcionka);
  52.         list.setBackground(Color.BLUE);
  53.         list.setSelectedTextColor(Color.YELLOW);
  54.         list.setForeground(Color.YELLOW);
  55.         this.add(list);
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement