ismaelvc

Hello.java

Nov 16th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1.  import javax.swing.*;
  2.  import java.awt.Dimension;
  3.  
  4.  public class Hola extends JFrame {
  5.      Hola() {
  6.          setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
  7.          setPreferredSize(new Dimension(300, 300));
  8.          add(new JLabel("Hola, mundo en: Java"));
  9.          pack();
  10.      }
  11.  
  12.      public static void main(String[] args) {
  13.          JTextField titulo = new JTextField("Ejemplo Java.");
  14.          Hola marco = new Hola();
  15.          marco.setTitle(titulo.getText());
  16.          marco.setVisible(true);
  17.      }
  18.  }
Advertisement
Add Comment
Please, Sign In to add comment