HeadOut = Headsock.getOutputStream();
} catch (Exception ex) {
System.err.println("Could not connect to " + "131.120.101.81" + ". Quitting.");
System.exit(0);
}
try {
inHead = (HeadIn.readLine());
} catch (Exception ex) {}
//UPDATE COURSE TEXTBOX
inHead = inHead.substring(1,4);
head.setText(inHead);
//NETWORKING for CLIENT/SERVER
try {
GPSsock = new Socket("131.120.101.81", 2002);
GPSIn = new BufferedReader(new InputStreamReader(GPSsock.getInputStream()));
GPSOut = GPSsock.getOutputStream();
} catch (Exception ex) {
System.err.println("Could not connect to " + "131.120.101.81" + ". Quitting.");
System.exit(0);
}
try {
inGPS = (GPSIn.readLine());
} catch (Exception ex) {}
// CHECK FOR A GOOD GPS HIT THEN UPDATE TEXTBOXES
int GPSlength = inGPS.length();
if(GPSlength > 92){
inlat = inGPS.substring(24,36);
inlongi = inGPS.substring(37,50);
lat.setText(inlat);
longi.setText(inlongi);
}
else{
lat.setText(nohit);
longi.setText(nohit);
}
}
}
);
Go.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent ev) {
Comentarios a estos manuales