Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. public class Main {
  2.  
  3.     public static void main(String[] args) {
  4.  
  5.         int x = 1;
  6.         String schrei = "David kanns jetzt";
  7.         while( x <=20)
  8.         { System.out.println (schrei);
  9.             x= x+1;}
  10.         if (x >=20)
  11.             public static synchronized void playSound (final String url) {
  12.             new Thread(new Runnable() {
  13.  
  14.                 public void run() {
  15.                     try {
  16.                         Clip clip = AudioSystem.getClip();
  17.                         AudioInputStream inputStream = AudioSystem.getAudioInputStream(
  18.                                 Main.class.getResourceAsStream("C:\\Users\\David\\Desktop" + url));
  19.                         clip.open(inputStream);
  20.                         clip.start();
  21.                     } catch (Exception e) {
  22.                         System.err.println(e.getMessage());
  23.                     }
  24.                 }
  25.             }).start();
  26.         }
  27.  
  28.  
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement