I am new to java, how does returning value work? I need to return the width of an GLabel, to use it in another method
private double createLabel(String text, int locX, int locY){
double widthOfLabel = labelText.getWidth();
return widthOfLabel;
}
(I've cut out the un=important parts) but this should return the width of the label.
how do i use it within another method?
private void getWidthofLabel(){
double name = ?????????
}
I tried some different stuff, but they all seem to just return null. One more thing when I get the return value of the createLabel method, do I have to set it´s parameters (string,int,int)? I don´t want that, but the debugger seems to force me to set them.