Hi, Thank you at before.
Now I mean another problem.
I do sequential explanation.
http://cfile25.uf.tistory.com/image/125E6C4251488740021345
First. the Virus Panel Clicked.
http://cfile4.uf.tistory.com/image/0252FA4251488740138A19
Second. that opposite add Green Ground(Y-95 location).
Third. Green Ground(in Y-95) was clicked by mouse.
http://cfile4.uf.tistory.com/image/273AB34251488740342F0B
Fourth. Virus Panel move Y-95(forward).
http://cfile24.uf.tistory.com/image/124E9042514887411A2439
Fifth. the Link Panel Clicked.
Sixth. that opposite add Green Ground(Y-95 location).
Seventh. seem third. (Green Ground(in Y-95) was clicked by mouse.)
http://cfile1.uf.tistory.com/image/1615A73E51488836129FD3
Eighth. Virus Panel move Y-95(forward)
originally, if Link Panel clicked by mouse, Link Panel go forward.
but Link Panel not moved instead of Virus Panel moved.
I think due final JPanel mvp. but, can’t remove final.
The eclipes have necessary final.
so, I think. Not used final variable, error don’t get out.
but it not possible. Used final variable, enable reset final variable or change value(address value) of final variable.
how to do?
class Object{
public static void main(String[] arg){
JPanel Virus = new JPanel(15,15,80,80);
JPanel Link = new JPanel(30,30,80,80);
Virus.visible(true);
Link.visible(true);
Virus.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
Moving mv= new Moving();
mv.move_AE(Virus);
}
});
Link.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
Moving mv= new Moving();
mv.move_AE(Link);
}
});
}
}
class Moving{
public void move_AF(JPanel mvp){
if(!(Virus.getY()<=123)){
move_N.setLocation(mvp.getX(), mvp.getY()-95); //Green Ground.
move_N.setVisible(true);
}
}
public void move_AE(final JPanel mvp){
move_N.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if(event){
move_set();
mvp.setLocation(mvp.getX(), mvp.getY()-95); // mvp(Virus or Link) is going forward
mvp.setVisible(true);
event=false;
}
}
});
}
}