質問編集履歴

2

インデントを修正しました。失礼しました。

2018/07/30 07:31

投稿

entd270
entd270

スコア19

test CHANGED
File without changes
test CHANGED
@@ -50,7 +50,7 @@
50
50
 
51
51
  public static void main(String[] args) {
52
52
 
53
- new mouseExec();
53
+ new mouseExec();
54
54
 
55
55
  }
56
56
 
@@ -58,41 +58,37 @@
58
58
 
59
59
  mouseExec(){
60
60
 
61
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
61
+ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
62
62
 
63
- getContentPane().setLayout(null);
63
+ getContentPane().setLayout(null);
64
64
 
65
- addMouseMotionListener(this);
65
+ addMouseMotionListener(this);
66
66
 
67
- setSize(700, 550);
67
+ setSize(700, 550);
68
68
 
69
- setVisible(true);
69
+ setVisible(true);
70
-
71
- }
72
70
 
73
71
 
74
72
 
75
73
  public void mouseDragged(MouseEvent e) {
76
74
 
77
- x = e.getX();
75
+ x = e.getX();
78
76
 
79
- y = e.getY();
77
+ y = e.getY();
80
78
 
81
- repaint();
79
+ repaint();
82
80
 
83
- }
81
+ }
84
82
 
85
-
86
-
87
- public void mouseMoved(MouseEvent e) {}
83
+ public void mouseMoved(MouseEvent e) {}
88
84
 
89
85
 
90
86
 
91
- public void paint(Graphics g){
87
+ public void paint(Graphics g){
92
88
 
93
- label.setBounds(x,y,50,50);
89
+ label.setBounds(x,y,50,50);
94
90
 
95
- }
91
+ }
96
92
 
97
93
  }
98
94
 

1

インデントを修正しました。失礼しました。

2018/07/30 07:31

投稿

entd270
entd270

スコア19

test CHANGED
File without changes
test CHANGED
@@ -74,23 +74,25 @@
74
74
 
75
75
  public void mouseDragged(MouseEvent e) {
76
76
 
77
- x = e.getX();
77
+ x = e.getX();
78
78
 
79
- y = e.getY();
79
+ y = e.getY();
80
80
 
81
81
  repaint();
82
82
 
83
- }
83
+ }
84
84
 
85
+
86
+
85
- public void mouseMoved(MouseEvent e) {}
87
+ public void mouseMoved(MouseEvent e) {}
86
88
 
87
89
 
88
90
 
89
- public void paint(Graphics g){
91
+ public void paint(Graphics g){
90
92
 
91
93
  label.setBounds(x,y,50,50);
92
94
 
93
- }
95
+ }
94
96
 
95
97
  }
96
98