Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4. import java.util.*;
  5. import java.awt.Dimension;
  6. import java.io.*;
  7.  
  8. public class odtwarzacz {
  9.  
  10.     public static void main (String[] args) {
  11.         JFrame oknoGlowne = new JFrame("Okno glowne programu");
  12.         oknoGlowne.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  13.         oknoGlowne.setPreferredSize(new Dimension(600, 400));
  14.         oknoGlowne.setResizable(false);
  15.         oknoGlowne.setVisible(true);
  16.         oknoGlowne.pack();
  17.         oknoGlowne.setLayout(new BorderLayout());
  18.        
  19.         JPanel panel = new JPanel(new GridBagLayout());
  20.         JButton b1 = new JButton("Przycisk PLAY");
  21.         JButton b2 = new JButton("Przycisk PAUZA");
  22.         JButton b3 = new JButton("Przycisk STOP");
  23.         GridBagConstraints layout = new GridBagConstraints();
  24.         layout.insets = new Insets(0, 10, 5, 0);
  25.         layout.anchor = GridBagConstraints.SOUTH;
  26.         layout.weighty = 1;
  27.        
  28.         panel.add(b1, layout);
  29.         panel.add(b2, layout);
  30.         panel.add(b3, layout);
  31.         oknoGlowne.add(panel, BorderLayout.CENTER);
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement