Guest User

Untitled

a guest
May 2nd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.49 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.     public static void main (String[] args) {
  10.             JFrame oknoGlowne = new JFrame("Odtwarzacz plikow MP3");
  11.             //oknoGlowne.setLayout(new GridLayout(4, 1));
  12.             //oknoGlowne.setSize(new Dimension(500,400));
  13.             //oknoGlowne.setMinimumSize(new Dimension(500,400));
  14.             //oknoGlowne.setMaximumSize(new Dimension(600,500));
  15.             oknoGlowne.setPreferredSize(new Dimension(800, 400));
  16.             //oknoGlowne.setResizable(false);
  17.             oknoGlowne.pack();
  18.             oknoGlowne.setLocationRelativeTo(null);
  19.             oknoGlowne.setVisible(true);
  20.             oknoGlowne.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  21.  
  22.             JPanel panel = new JPanel((new FlowLayout()));
  23.             panel.setSize(300, 300);
  24.             panel.setBackground(Color.red);
  25.             oknoGlowne.add(panel);
  26.             panel.setLayout(new BorderLayout());
  27.            
  28.             JPanel subPanel = new JPanel();
  29.            
  30.             JButton b1 = new JButton("Przycisk PLAY");
  31.             b1.setPreferredSize(new Dimension(150, 40));
  32.             b1.setBackground(Color.green);
  33.             subPanel.add(b1);
  34.             JButton b2 = new JButton("Przycisk PAUZA");
  35.             b2.setPreferredSize(new Dimension(150, 40));
  36.             b2.setBackground(Color.yellow);
  37.             subPanel.add(b2);
  38.             JButton b3 = new JButton("Przycisk STOP");
  39.             b3.setPreferredSize(new Dimension(150, 40));
  40.             b3.setBackground(Color.red);
  41.             subPanel.add(b3);
  42.             //panel.setBackground(Color.blue);
  43.             panel.add(subPanel, BorderLayout.SOUTH);
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment