thufir

Untitled

Aug 29th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. package teln;
  2.  
  3. import java.io.IOException;
  4. import java.net.SocketException;
  5. import java.net.UnknownHostException;
  6.  
  7. public final class Main extends Thread {
  8.  
  9. public void run() {
  10. final LoadMUD lm = new LoadMUD();
  11. final SwingStuff s = new SwingStuff();
  12. System.out.println("Hello from a thread!");
  13.  
  14. new Thread(new Runnable() {
  15.  
  16. public void run() {
  17. try {
  18. lm.mud();
  19. } catch (UnknownHostException ex) {
  20. } catch (SocketException ex) {
  21. } catch ( IOException | InterruptedException ex) {
  22. }
  23. }
  24. }).start();
  25.  
  26. new Thread(new Runnable() {
  27.  
  28. public void run() {
  29. try {
  30. s.someStuff();
  31. } catch (UnknownHostException ex) {
  32. } catch (SocketException ex) {
  33. } catch ( IOException | InterruptedException ex) {
  34. }
  35. }
  36. }).start();
  37.  
  38. }
  39.  
  40. public static void main(String[] args) throws UnknownHostException, SocketException, IOException, InterruptedException {
  41. (new Main()).start();
  42.  
  43.  
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment