Created
October 17, 2012 00:08
-
-
Save geovanerocha/3902919 to your computer and use it in GitHub Desktop.
Graphical Application @ Java
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 java.awt.BorderLayout; | |
import javax.swing.JFrame; | |
import javax.swing.JLabel; | |
import javax.swing.JPanel; | |
public class main extends JFrame { | |
JPanel panel; | |
JLabel msg; | |
public main() | |
{ | |
super("JAVA SWING, AWT"); | |
} | |
public void criaJanela() | |
{ | |
panel = new JPanel(); | |
msg = new JLabel("Testando aplicação gráfica com Java"); | |
panel.add(msg); | |
panel.setSize(500,500); | |
getContentPane().add(panel, BorderLayout.CENTER); | |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
pack(); | |
setVisible(true); | |
} | |
public static void main(String[] args) { | |
main Frame = new main(); | |
Frame.criaJanela(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment