Created
July 14, 2025 13:41
-
-
Save kurotori/3b85b0af145298f2570d462a40d1d9ac to your computer and use it in GitHub Desktop.
Java: Ventana básica con Swing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import interfaz.Inicio; | |
public class App { | |
public static void main(String[] args) throws Exception { | |
Inicio v1 = new Inicio(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Esta clase debe estar ubicado en un paquete llamado "interfaz" para que este código funcione corréctamente | |
package interfaz; | |
import javax.swing.JFrame; | |
public class Inicio extends JFrame { | |
public Inicio(){ | |
configurar(); | |
} | |
private void configurar(){ | |
setLayout(null); | |
setDefaultCloseOperation(EXIT_ON_CLOSE); | |
setSize(800,600); | |
setVisible(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment