View Single Post
  #1   Spotlight this post!  
Unread 10-02-2011, 09:42
ksanger's Avatar
ksanger ksanger is offline
Registered User
FRC #0211 (MaK)
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Rochester NY
Posts: 62
ksanger is on a distinguished road
Joystick(int,int,int) has protected access

Java Help;

We are copying examples out of WPI Robotics Library User’s Guide.pdf which state that we may define a new Joystick(int USBPort#, int #ofAxis, int #ofButtons) but when we do so Netbeans gives us an error stating that

"Joystick(int,int,int) has protected access in edu.wpi.first.pwilibj.Joystick ..."

Alt Ent shows hints which repeats the same message.

First what does this mean, and second how do we fix it. Our team wants to use a gamepad... And we were hoping to be able to determine what the gamepad response is tonight.

We did find Joystic.java and see that Joystick( int port, int numAxisTypes, int numButtonTypes){} is defined as protected. Can we just change this to public? Is this a bug? (note changing it to public and saving the file hasn't worked yet.) (note again, quite Netbeans, restarted, and now have no error message). This is extremely frustrating as the documentation didn't work the first time and I don't know if what I did to fix it is correct, nor if it broke something else?

New questions;
1) If we change a library function should we create a new copy of it and put it in our current project instead of using the library?
2) Why didn't Netbeans see the library change until we restarted it?
3) How do we determine if our change doesn't cause additional problems and break something else?
Reply With Quote