#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    20
    Rep Power
    0

    Help With JTextField


    Hi im trying to store the userinput into a global static variable by using the .getText() method however Its not working help me please.

    Code:
    private static
     String words; 
    private static int key = 5; 
    private static String cipherd;
     private static String decipherd;
    
    public static void main(String[] args) 
    	{
    		{
    			SwingUtilities.invokeLater(new Runnable()
    			{
    				public void run()
    				{
    					createAndShowGUI();
    				}
    			});
    		}
    		
    		 
    		key = random();
    		words = getText();
    		cipherd = encrpt(words, key);
    		decipherd = decrpt(cipherd, key);
    	}
    	
    	
    
    	private static String getText() 
    	{
    		String word = userinput.getText();
    		
    		return word;
    	}
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,724
    Rep Power
    348
    Its not working
    Can you explain what "not working" means? If you get compiler errors, copy the full text of the error messages and paste it here.

IMN logo majestic logo threadwatch logo seochat tools logo