Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. private void Button_GOMouseClicked(java.awt.event.MouseEvent evt) {
  2. String c=TextArea_IO.getText();
  3. if(c=="a")
  4. {
  5. try
  6. {
  7.  
  8. if ((new File("c:\\Users\\Federico\\Desktop\\rinuncia_studi.pdf")).exists())
  9. {
  10.  
  11. Process p = Runtime
  12. .getRuntime()
  13. .exec("rundll32 url.dll,FileProtocolHandler c:\\Users\\Federico\\Desktop\\rinuncia_studi.pdf");
  14. TextArea_IO.setText("PORCODDIO");
  15.  
  16. p.waitFor();
  17.  
  18. }
  19. else
  20. {
  21.  
  22. TextArea_IO.setText("File does not exist");
  23.  
  24. }
  25.  
  26. TextArea_IO.setText("There you go");
  27.  
  28. }
  29. catch (Exception ex)
  30. {
  31. ex.printStackTrace();
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement