Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.Dimension;
- public class Hola extends JFrame {
- Hola() {
- setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
- setPreferredSize(new Dimension(300, 300));
- add(new JLabel("Hola, mundo en: Java"));
- pack();
- }
- public static void main(String[] args) {
- JTextField titulo = new JTextField("Ejemplo Java.");
- Hola marco = new Hola();
- marco.setTitle(titulo.getText());
- marco.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment