I'm trying to get the last two characters in a string for inches and the first two characters for feet. Is there something I'm not seeing because I've tried a lot of things.
The heights are supposed to have a space between two sets of numbers something like 5 10 or 12 02 so that's why I'm trying to get certain characters. It's so I can move them into another string to add them together because I'm suppose to add two peoples heights together and this is what I got so far...
import javax.swing.JOptionPane;
public class TestProgramming
{ //begin class
public static void main(String[] args)
{ // begin main
// ***** variables *****
    int h1;
    int h2;
    String height1 = "0";
    String height2 = "0";
    String  feet1;
    String  feet2;
    String inches1;
    String inches2;
    String FinalFoot = "0";
    String FinalInch = "12";
// ***** input box 1 ***** 
    height1 = JOptionPane.showInputDialog (null, "Please enter the height of the first person in inches.");
// ***** input box 2 ***** 
    height2 = JOptionPane.showInputDialog (null, "Please enter the height of the second person in inches.");  
// ***** parse ***** 
    h1 = Integer.parseInt(height1);
    h2 = Integer.parseInt(height2);
// ***** integer to string *****
    Integer.toString(h1);
    Integer.toString(h2);
// ***** taking the feet and inches from the two heights ***** 
    feet1 = h1.substr(0, 1);            // subtract the last 2 numbers
    inches1 = h1.substr(2, 4);      // subtract the first 2 numbers
    feet2 = h2.substr(0, 1);        // subtract the last 2 numbers
    inches2 = h2.substr(2, 4);      // subtract the first 2 numbers
As you can see, I'm having problems where it says "taking the feet and inches from the two heights".
 
     
     
     
     
     
    