Commit e799ad56 by Adam Gerber

you have a functioning swing app

parent b07a7103
Showing with 41 additions and 0 deletions
package lec05.glab.swing;
import javax.swing.*;
import java.awt.*;
/**
* Created by Adam on 11/2/2015.
*/
public class Painter {
//define a frame
private JFrame frm;
//creaete a main method that insantiates the ecnlosing object
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Painter window = new Painter();
window.frm.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
//constructor calls init
public Painter() {
initialize();
}
//our init methhod
private void initialize() {
frm = new JFrame();
frm.setBounds(100, 100, 450, 476);
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment