Advertisement
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("Okno glowne programu");
- oknoGlowne.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- oknoGlowne.setPreferredSize(new Dimension(600, 400));
- oknoGlowne.setResizable(false);
- oknoGlowne.setVisible(true);
- oknoGlowne.pack();
- oknoGlowne.setLayout(new BorderLayout());
- JPanel panel = new JPanel(new GridBagLayout());
- JButton b1 = new JButton("Przycisk PLAY");
- JButton b2 = new JButton("Przycisk PAUZA");
- JButton b3 = new JButton("Przycisk STOP");
- GridBagConstraints layout = new GridBagConstraints();
- layout.insets = new Insets(0, 10, 5, 0);
- layout.anchor = GridBagConstraints.SOUTH;
- layout.weighty = 1;
- panel.add(b1, layout);
- panel.add(b2, layout);
- panel.add(b3, layout);
- oknoGlowne.add(panel, BorderLayout.CENTER);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement