yumi1996

Ambiguous error message

Sep 13th, 2013
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. //The purpose of this class is to create a JButton that launches a program shortcut when it is pressed
  2. //if there are better ways to do this, I would appreciate the help.
  3.  
  4. public class Launcherbutton extends JButton {
  5.  
  6.  
  7.  
  8. public Launcherbutton() {
  9.  
  10. addMouseListener(new MouseListener() {
  11.  
  12. @Override
  13. public void mouseClicked(MouseEvent arg0) {
  14.  
  15.  
  16. }
  17.  
  18. @Override
  19. public void mouseEntered(MouseEvent arg0) {
  20.  
  21.  
  22. }
  23.  
  24. @Override
  25. public void mouseExited(MouseEvent arg0) {
  26.  
  27.  
  28. }
  29.  
  30. public void mousePressed(MouseEvent arg0, String pathdir) {
  31.  
  32. ProcessBuilder pb = new ProcessBuilder("cmd", pathdir);//launches a .exe shortcut file from a directory
  33.  
  34. Process p = pb.start();
  35. p.waitFor();
  36.  
  37. }
  38.  
  39. @Override
  40. public void mouseReleased(MouseEvent arg0) {
  41.  
  42.  
  43. }
  44.  
  45. @Override
  46. public void mousePressed(MouseEvent e) {
  47.  
  48.  
  49. }
  50.  
  51. }//error message occurs here
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment