result line break.
Hello there. I am in a java programming class at my school and we needed to make a program that takes Meters/sec and converts it into Miles/hour, as well as feet/sec converting it into the same thing. I know how to do the math fine and I get the results up fine and everything. My problem is my results don't fit on the screen. Its just one bit line that goes off the form, I can make the form bigger to show everything, but that seems roundabout. I want to know if there is a command that will break up my results and move them to new lines. I tried using /n and /r, but they did now work. This is my first time here, so I don't know if I need to put in the entire code or not, so here is just part of it.
// Get values used in calculation
fps = Integer.parseInt(fpsField.getText());
mps = Integer.parseInt(mpsField.getText());
// Do calculations
mph = fps * 60 * 60 / 5280;
mphh = mps * 3 * 60 * 60 / 5280;
// Provide user with result of calculation
outputLabel.setText("Your Speed in MPH from FPS is " + mph + "And your speed from Meter/sec is " + mphh);
It prints my results on one line and I want to break it where it starts, "And your...." Any help would be great. Thanks
|