Closed sinadarvi closed 7 years ago
Hello, if you can provide the whole code, we might be able to help. otherwise will close this issue, as the provided info is not enough.
Regards,
hi, okey, here is my code :
JFXTextField ipGrabber = new JFXTextField();
JFXTextField portGrabber = new JFXTextField();
ipGrabber.setPromptText("IP :");
ipGrabber.setText("192.168.26.1");
portGrabber.setPromptText("Port :");
portGrabber.setText("26881");
JFXButton connect = new JFXButton("Connect");
connect.setOnAction(event -> {
if(ipGrabber.getText()!=null && portGrabber.getText()!=null) {
mclient.serverIP = ipGrabber.getText();
mclient.serverPort = Integer.parseInt(portGrabber.getText());
}
and here is erorr:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at controllers.MowerStatusController.lambda$initializeConnectingLayout$1(MowerStatusController.java:147) //code : mclient.serverIP = ipGrabber.getText();
Are you certain that mclient
isn't null
?
@thetric no.thanks. mclient
was null.
problem fixed.
sorry for interrupting...
hi, i do this :
and after that i do this
and i get NullPointerException on
text.getText()
!!!i think it's cause of
textIsNull
, but i don't sure!! thanks.