JetSerge

SomeTest.java

Mar 28th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3.  
  4. /**
  5.  * Created by kirill on 06.03.17.
  6.  */
  7. public class SomeTest implements Runnable {
  8.     public static void main(String[] args) {
  9.         SwingUtilities.invokeLater(new SomeTest());
  10.     }
  11.  
  12.     public void run() {
  13.         JFrame frame = new JFrame("Test frame");
  14.         frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
  15.  
  16.         JPanel panel = new JPanel();
  17.         panel.setPreferredSize(new Dimension(800, 600));
  18.         frame.add(panel, BorderLayout.CENTER);
  19.  
  20.         frame.pack();
  21.         frame.setVisible(true);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment