発生している問題・エラーメッセージ
./org/jyl/base/event/JylMouseWheelEvent.java:12: エラー: シンボルを見つけられません this.button = button; このようなエラーがあといくつか
該当のソースコード
継承元
Java
1package org.jyl.base.event; 2 3public class JylMouseEvent 4{ 5 int button = 0; // 変更されたボタン 6 int x = 0, y = 0; // マウスの位置 7 int clickcount = 0; // クリックの回数 8 long when = 0; // 押された時間 9 10 JylMouseEvent(){} 11 12 private JylMouseEvent( int button, int ccount, int x, int y, long when ) 13 { 14 this.button = button; 15 clickcount = ccount; 16 this.x = x; this.y = y; 17 this.when = when; 18 } 19 20 public int getButton() 21 { 22 return button; 23 } 24 25 public int getClickCount() 26 { 27 return clickcount; 28 } 29 30 JylMouseEvent getInstance( int button, int ccount, int x, int y, long when ) 31 { 32 JylMouseEvent mouse = new JylMouseEvent( button, ccount, x, y, when ); 33 return mouse; 34 } 35 36 public long getWhen() 37 { 38 return when; 39 } 40 41 public int getX() 42 { 43 return x; 44 } 45 46 public int getY() 47 { 48 return y; 49 } 50} 51
継承後クラス
package org.jyl.base.event; public class JylMouseWheelEvent extends JylMoseEvent { int iclick = 0; // マウスホイールのクリック数 double dclick = 0.0; // マウスホイールの回転数 JylMouseWheelEvent(){} private JylMouseWheelEvent( int button, int ccount, int x, int y, int ic, double dc, long when ) { this.button = button; clickcount = ccount; this.x = x; this.y = y; iclick = ic; dclick = dc; this.when = when; } JylMouseWheelEvent getInstance( int button, int ccount, int x, int y, int ic, double dc, long when ) { JylMouseWheelEvent mouse = new JylMouseWheelEvent( button, ccount, x, y, ic, dc, when ); return mouse; } public double getPreciseWheelRotation() { return dclick; } public int getWheelRotation() { return iclick; } }
###問題
なぜ継承元のクラス変数が使えないのでしょうか。
試したこと
継承についてネットで再確認
変数がprivateではないのを確認
protected は javadoc に表示されてしまうので避けたいです。
回答1件
あなたの回答
tips
プレビュー