seba_14

AprendiendoSwing_1

Aug 16th, 2016
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import javax.swing.*;
  2.  
  3. public class CreandoMarcos {
  4.  
  5.     public static void main(String[] args) {
  6.         miMarco m = new miMarco();
  7.  
  8.     }
  9. }
  10.  
  11. // mi marco hereda de jframe para utilizar todos los metodos correspondientes a
  12. // swing
  13.  
  14. class miMarco extends JFrame {
  15.  
  16.     // constructor
  17.     public miMarco() {
  18.         // tamaño de mi ventana
  19.         setSize(500, 300);
  20.         // instancio y itulizo el metodo para hacer visible la ventana ya que
  21.         // esta invisible por defecto
  22.         setVisible(true);
  23.         // utilizo este metodo para finalizar la ejecucion despues de que
  24.         // presione
  25.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  26.  
  27.     }
  28. }
Add Comment
Please, Sign In to add comment