java error; cannot find symbol

/* programmer: andrewdate:2/1/06

purpose: to fix code

*/

import javax.swing.*;

class number16

{

public static void main ( String [] args)

{

JFrame jFrame;

String name = new String( "Sally Matter");

jFrame = new JFrame ();

jFrame.setSize( 400, 300);

jFrame.setVisible( true);

JOptionPane.showMessageDialog( jFrame, name );

JOptionPane.showMessageDialog( jFrame, "How are you?");

JOptionPane.showMessageDialog( null, "Good Bye" );

JOptionPane.showMessageDialog( null, "one \ntwo \nthree");

JOptionPane.showMessageDialog( jFrame, name.substring (0, 4));

JOptionPane.showMessageDialog( jFrame, name.length());

JOptionPane.showMessageDialog( jFrame, name.substring(8, 12));

JOptionPane.showMessageDialog( jFrame, name.substring(0, 1)+name.substring(7, 9));

JOptionPane.showMessageDialog( jFrame, name.substring(5, 6)+name.substring(name.length() -3, text.length() ));

System.out.println( name.indexOf("M") );

System.out.println( name.indexOf("ter") );

System.out.println( name.length() );

System.exit(0);

}

}

i dont know if this will help or not. when i try to compile it says

number16:28:cannot find symbol

symbol:variable text

location: class number16

JOptionPane.showMessageDialog( jFrame, name.substring(5, 6)+name.substring(name.length() -3, text.length() ));

[1458 byte] By [snoborder87a] at [2007-10-2 11:11:19]
# 1
fixed... line 28 (name.length....and then i had text.length..) changed to name and worked
snoborder87a at 2007-7-13 3:54:12 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

Hi,

use

JOptionPane.showMessageDialog( jFrame, name.substring(5, 6)+name.substring(name.length() -3, name.length() ));

in place of text because u have taken the undefined variable name

So its giving Error.

It will remove the Error.

Warm Regards

Kamal

Kam_indiaa at 2007-7-13 3:54:12 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...