Quantcast
Channel: Developer Feed - Snippet
Viewing all articles
Browse latest Browse all 178

How do you create a simple Swing based Window with Frame?

$
0
0

  1. importjava.awt.EventQueue;
  2.  
  3. importjavax.swing.JFrame;
  4.  
  5.  
  6. publicclass MainWindow {
  7.  
  8.      privateJFrame frame;
  9.  
  10.      /**
  11.      * Launch the application.
  12.      */
  13.      publicstaticvoid main(String[] args){
  14.           EventQueue.invokeLater(newRunnable(){
  15.                publicvoid run(){
  16.                     try{
  17.                          MainWindow window =new MainWindow();
  18.                          window.frame.setVisible(true);
  19.                     }catch(Exception e){
  20.                          e.printStackTrace();
  21.                     }
  22.                }

read more


Viewing all articles
Browse latest Browse all 178

Trending Articles