Advertisement
kajacx

Java area chceck

Apr 16th, 2012
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. while(true) {
  2.  String selection = textArea.getSelectedText(); //název tý textarea
  3.  if(selection!=null && selection.length()!=0) {
  4.   System.out.println("není nic vybráno");
  5.  }
  6.  else {
  7.   System.out.println("je vybrán tect o délce "+selection.length());
  8.  }
  9.  
  10.  // "spát" po dobu 150 ms
  11.  try {
  12.   Thread.sleep(150);
  13.  } catch(InterruptedException ex) {
  14.   //pokud nás někdo probudí, prostě nebudem nic dělat :)
  15.  }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement