Thread: Xbox Controller
View Single Post
  #15   Spotlight this post!  
Unread 23-06-2014, 15:59
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Xbox Controller

Quote:
Originally Posted by LFRobotics View Post
Ok AWESOME - now this may seem like a dumb question to you but im a beginner programmer so here it is

How exactly do I extend the Joystick class - I tried it like this:

Code:
public class XBox extends Joystick {
}
but Netbeans doesn't like that

When you say



do you want that in the class and would that just look like



THANKS for all your help!
That is the correct way to extend a class. The compiler is most likely complaining about the missing constructor. Anything that extends the Joystick class is required to have a constructor that calls the Joystick(int port) constructor. So your constructor will look like this inside of your class:

Code:
public XBox(int port) {
     super(port);
}
The super() method will call the super class's (Joystick) constructor.
Reply With Quote