Buggy code:
public class PiMain extends Application { private BorderPane root ; private AnchorPane rpane ; private FXMLLoader fxmlLoader ; Scene PiScene ; int PiWindowWidth = 800 ; int PiWindowHeight = 1000 ; double PiStrokeWidth = 1.5 ; static Paint PiLineDefColour = Color . DARKGRAY ; static Paint PiLineSelColour = Color . CRIMSON ; static double PiLineWidth = 2.5 ; Path linePath ; PiController piController ; PiSplashController pisplashController ; String label ; int sf ; int sfd = 1000 ; double xa1 ; double xa2 ; double ya1 ; double ya2 ; double diff ; protected double initialX ; protected double initialY ; static String PiVersion = "v2.0" ; @ Override public void start ( Stage primaryStage ) { } public void pause ( ) { } class MouseHandler implements EventHandler < MouseEvent > { private boolean gotFirst = false ; private Line line ; private Pane pane ; private double x1 ; private double y1 ; private double x2 ; private double y2 ; private PiMain . LineHandler lineHandler ; public MouseHandler ( Pane pane ) { } @ Override public void handle ( MouseEvent event ) { if ( ( ( event . getClickCount ( ) ) == 2 ) && ( event . isPrimaryButtonDown ( ) ) ) { if ( ! ( gotFirst ) ) { x1 = x2 = event . getX ( ) ; xa1 = piController . getxAxis ( xa1 ) ; y1 = y2 = event . getY ( ) ; ya1 = piController . getyAxis ( ya1 ) ; line = new Line ( x1 , y1 , x2 , y2 ) ; line . setStrokeWidth ( PiMain . PiLineWidth ) ; line . setStroke ( PiMain . PiLineDefColour ) ; pane . getChildren ( ) . add ( line ) ; gotFirst = true ; } else { line . setOnMouseEntered ( lineHandler ) ; line . setOnMouseExited ( lineHandler ) ; line . setOnMouseDragged ( lineHandler ) ; line . setOnMousePressed ( lineHandler ) ; line . setOnMouseClicked ( lineHandler ) ; line . setOnMouseReleased ( lineHandler ) ; line = null ; gotFirst = false ; } } else { if ( ( line ) != null ) { x2 = event . getX ( ) ; xa2 = piController . getxAxis ( xa2 ) ; y2 = event . getY ( ) ; ya2 = piController . getyAxis ( ya2 ) ; line . setEndX ( x2 ) ; line . setEndY ( y2 ) ; diff = ( xa2 ) - ( xa1 ) ; <START_BUG> label = String . format ( "Voltage<seq2seq4repair_space>:<seq2seq4repair_space>%f<seq2seq4repair_space>V<seq2seq4repair_space>Time:<seq2seq4repair_space>%f<seq2seq4repair_space>s<seq2seq4repair_space>Frequency<seq2seq4repair_space>:<seq2seq4repair_space>%f<seq2seq4repair_space>Hz" , ( ( ya2 ) - ( ya1 ) ) , ( ( xa1 ) - ( xa2 ) ) , ( 1 // ( ( xa1 ) - ( xa2 ) ) ) ) ; <END_BUG> piController . update ( label ) ; } } } } class LineHandler implements EventHandler < MouseEvent > { double x ; double y ; Pane pane ; public LineHandler ( Pane pane ) { } @ Override public void handle ( MouseEvent e ) { Line l = ( ( Line ) ( e . getSource ( ) ) ) ; if ( ( ( e . getEventType ( ) ) == ( MouseEvent . MOUSE_PRESSED ) ) && ( e . isSecondaryButtonDown ( ) ) ) { pane . getChildren ( ) . remove ( l ) ; } else if ( ( ( e . getEventType ( ) ) == ( MouseEvent . MOUSE_DRAGGED ) ) && ( e . isPrimaryButtonDown ( ) ) ) { double tx = e . getX ( ) ; double ty = e . getY ( ) ; double dx = tx - ( x ) ; double dy = ty - ( y ) ; l . setStartX ( ( ( l . getStartX ( ) ) + dx ) ) ; l . setStartY ( ( ( l . getStartY ( ) ) + dy ) ) ; l . setEndX ( ( ( l . getEndX ( ) ) + dx ) ) ; l . setEndY ( ( ( l . getEndY ( ) ) + dy ) ) ; x = tx ; y = ty ; } else if ( ( e . getEventType ( ) ) == ( MouseEvent . MOUSE_ENTERED ) ) { x = e . getX ( ) ; y = e . getY ( ) ; l . setStroke ( PiMain . PiLineSelColour ) ; } else if ( ( e . getEventType ( ) ) == ( MouseEvent . MOUSE_EXITED ) ) { l . setStroke ( PiMain . PiLineDefColour ) ; } e . consume ( ) ; } } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
label = String . format ( "Voltage<seq2seq4repair_space>:<seq2seq4repair_space>%f<seq2seq4repair_space>V<seq2seq4repair_space>Time:<seq2seq4repair_space>%f<seq2seq4repair_space>s<seq2seq4repair_space>Frequency<seq2seq4repair_space>:<seq2seq4repair_space>%f<seq2seq4repair_space>Hz" , ( ( ya2 ) - ( ya1 ) ) , ( ( xa2 ) - ( xa1 ) ) , ( 1 // ( ( xa2 ) - ( xa1 ) ) ) ) ;