Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2227

output to TextArea

Newsgroups comp.lang.java.help
Date 2012-11-05 04:00 -0800
Message-ID <d16bac4f-6997-409e-a7ae-8242371d4b4c@googlegroups.com> (permalink)
Subject output to TextArea
From Bob <bherbst65@hotmail.com>

Show all headers | View raw


Hi All, 
The shuffle output is now 
System.out.println(dummy+input); 
I would want to know what to code it so 
that it appears in the JTextArea.
(code snip)

   public void actionPerformed(ActionEvent e) {
      String text = wordField.getText() ;

      if (e.getActionCommand().equals("GrabItAll")) {
         shuffle("",text);
      }else if (e.getActionCommand().equals("close")) {System.exit(0);}
   }
   
   public static void shuffle(String dummy, String input){
      JTextArea wordArea = new JTextArea(15, 20);
      
      if(input.length() <= 1) 
        System.out.println(dummy+input); 
      else {
         for(int i=0; i <input.length();i++){
            //wordArea.add(String(shuffle(dummy+input.charAt(i), input.substring(0, i) + input.substring(i+1, input.length()))));
            shuffle(dummy+input.charAt(i), input.substring(0, i) + input.substring(i+1, input.length()));
         }   
      }
   } 

TIA
Bob

Back to comp.lang.java.help | Previous | NextNext in thread | Find similar | Unroll thread


Thread

output to TextArea Bob <bherbst65@hotmail.com> - 2012-11-05 04:00 -0800
  Re: output to TextArea markspace <-@.> - 2012-11-05 09:41 -0800
  Re: output to TextArea Jeff Higgins <jeff@invalid.invalid> - 2012-11-05 15:40 -0500
  Re: output to TextArea Roedy Green <see_website@mindprod.com.invalid> - 2012-11-06 09:11 -0800
  Re: output to TextArea Bob <bherbst65@hotmail.com> - 2012-11-07 05:00 -0800

csiph-web