Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- public class klasa {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- JFrame okno = new JFrame("nasze pierwsze okno");
- Container kontener=okno.getContentPane();
- JButton przycisk = new JButton("ok");
- przycisk.setBackground(Color.RED);
- przycisk.setForeground(Color.BLUE);
- kontener.add(przycisk);
- okno.pack();
- okno.setSize(300,200);
- okno.setResizable(false);
- okno.setLocation(200,200);
- okno.setVisible(true);
- }
- }
Add Comment
Please, Sign In to add comment