Java Reference
In-Depth Information
else if (source == fClearButton) {
fHistData.clear ();
// For adaptable histogram, clear bins
// and also clear internal data array.
fHistChan.reset ();
repaint ();
}
else if (!fInBrowser) // Exit button
System.exit (0);
} // actionPerformed
/**
* Make the connection to the server. Set up the
* DataReader and begin recording the data from the
* server. **/
public void start () {
// If already connected, then stop the current
// connection before continuing to set up this new
// connection.
if (fConnected) stop ();
// Clear the histograms
fHistData.clear ();
fHistData.clear ();
// Get the current values of the host IP address and
// and the username
fHost = fHostField.getText ();
fUserName = fUserNameField.getText ();
try {
fChannelToMonitor =
Integer.parseInt (fChanField.getText ());
}
catch (NumberFormatException ex) {
println ("Bad channel value");
return;
}
// Now try to connect to the DataServer
try {
if (connect ()) {
// Successful so set flags and change button text
fConnected = true;
fStartButton.setText ( " Stop " );
fStatusLabel.setText ( " Connected " );
 
Search WWH ::




Custom Search