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
3ca240fb
authored
Nov 02, 2015
by
Adam Gerber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic siwng app
parent
36d6c316
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
src/lec05/glab/moreswing2/MouseClicker.java
src/lec05/glab/moreswing2/MouseClicker.java
0 → 100644
View file @
3ca240fb
package
lec05
.
glab
.
moreswing2
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
java.awt.event.MouseListener
;
import
java.awt.event.MouseMotionListener
;
/**
* Created by Adam on 11/2/2015.
*/
public
class
MouseClicker
{
//step creat the frame
private
JFrame
frm
;
private
JPanel
mPanelCenter
;
//step 2 create create the swing main method
public
static
void
main
(
String
[]
args
)
{
EventQueue
.
invokeLater
(
new
Runnable
()
{
public
void
run
()
{
try
{
MouseClicker
window
=
new
MouseClicker
();
window
.
frm
.
setVisible
(
true
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
});
}
//4 call init from the construtor
public
MouseClicker
()
{
initialize
();
}
//3 create the intialize method
private
void
initialize
()
{
frm
=
new
JFrame
();
frm
.
setBounds
(
100
,
100
,
450
,
476
);
frm
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
mPanelCenter
=
new
JPanel
();
}
}
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