Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.*;
- import java.util.*;
- import java.awt.Dimension;
- import java.io.*;
- public class odtwarzacz {
- public static void main (String[] args) {
- JFrame oknoGlowne = new JFrame("Odtwarzacz plikow MP3");
- //oknoGlowne.setLayout(new GridLayout(4, 1));
- //oknoGlowne.setSize(new Dimension(500,400));
- //oknoGlowne.setMinimumSize(new Dimension(500,400));
- //oknoGlowne.setMaximumSize(new Dimension(600,500));
- oknoGlowne.setPreferredSize(new Dimension(800, 400));
- //oknoGlowne.setResizable(false);
- oknoGlowne.pack();
- oknoGlowne.setLocationRelativeTo(null);
- oknoGlowne.setVisible(true);
- oknoGlowne.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- JPanel panel = new JPanel((new FlowLayout()));
- panel.setSize(300, 300);
- panel.setBackground(Color.red);
- oknoGlowne.add(panel);
- panel.setLayout(new BorderLayout());
- JPanel subPanel = new JPanel();
- JButton b1 = new JButton("Przycisk PLAY");
- b1.setPreferredSize(new Dimension(150, 40));
- b1.setBackground(Color.green);
- subPanel.add(b1);
- JButton b2 = new JButton("Przycisk PAUZA");
- b2.setPreferredSize(new Dimension(150, 40));
- b2.setBackground(Color.yellow);
- subPanel.add(b2);
- JButton b3 = new JButton("Przycisk STOP");
- b3.setPreferredSize(new Dimension(150, 40));
- b3.setBackground(Color.red);
- subPanel.add(b3);
- //panel.setBackground(Color.blue);
- panel.add(subPanel, BorderLayout.SOUTH);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment