View Single Post
  #1   Spotlight this post!  
Unread 24-09-2010, 20:49
nealpatel nealpatel is offline
Registered User
FRC #1777
 
Join Date: Jan 2010
Location: Lenexa, KS
Posts: 8
nealpatel is an unknown quantity at this point
Access Classes from different file

Does anyone know how to access java classes from a different file? We have always used only one file for all code but now it's so big so I was wondering if there is any way (I'm sure there is some way but idk) to do that.

Like for "User Messages", we made a class "writeUM".

Quote:
public void writeUM(int line, String Message) {

if(line == 1) {
uM.println(DriverStationLCD.Line.kMain6, 1, Message);
uM.updateLCD();
}
else if(line == 2) {
uM.println(DriverStationLCD.Line.kUser2, 1, Message);
uM.updateLCD();
}
else if(line == 3) {
uM.println(DriverStationLCD.Line.kUser3, 1, Message);
uM.updateLCD();
}
else if(line == 4) {
uM.println(DriverStationLCD.Line.kUser4, 1, Message);
uM.updateLCD();
}
else if(line == 5) {
uM.println(DriverStationLCD.Line.kUser5, 1, Message);
uM.updateLCD();
}
else if(line == 6) {
uM.println(DriverStationLCD.Line.kUser6, 1, Message);
uM.updateLCD();
}
}
So this is at the end of our program. I was wondering if I can put this in a different file and call that file instead.

Thanks.

.
__________________
-------------------------------------------------
Neal Patel
Team 1777
Shawnee Mission West
Viking Robotics

e-mail: neal.patel11@yahoo.com
Reply With Quote