Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Adam Gerber
/
labJava
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e799ad56
authored
Nov 02, 2015
by
Adam Gerber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
you have a functioning swing app
parent
b07a7103
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
src/lec05/glab/swing/Painter.java
src/lec05/glab/swing/Painter.java
0 → 100644
View file @
e799ad56
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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment