Results 1 to 4 of 4
Thread: Execute code from ActionListener
- 05-29-2010, 07:25 AM #1
Member
- Join Date
- May 2010
- Posts
- 2
- Rep Power
- 0
Execute code from ActionListener
Hello everyone,
I am new to this forum and very very new to Java, so please ignore my ignorance :)
I've implemented button in Applet, using actionPerformed to make it do some action. Button works when interacting with some of textboxes but no when I try for example to delete a textfile. The code for deleting is correct and works when executed from main method.
How can I make the delete code to be executed after the button is pressed???
Thank for any help.
- 05-29-2010, 08:14 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,410
- Blog Entries
- 7
- Rep Power
- 17
You wrote about an Applet and a main( ... ) method; Applets don't have a main( ... ) method so I assume you tested your code in an ordinary application where it works while it doesn't work in your Applet. Applets run under a SecurityManager that doesn't allow access to the filing system. Applications can do what they want.
kind regards,
Jos
- 05-29-2010, 04:45 PM #3
Member
- Join Date
- May 2010
- Posts
- 2
- Rep Power
- 0
Thank you very much for your help. Now I understand the problem.
- 05-29-2010, 05:10 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,410
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
NullPointerException by ActionListener
By YouGina in forum AWT / SwingReplies: 8Last Post: 07-10-2009, 11:08 AM -
Compile/Execute code in Java app
By Doctor Cactus in forum New To JavaReplies: 5Last Post: 12-16-2008, 09:58 AM -
Java actionlistener help
By justsomeguy in forum AWT / SwingReplies: 1Last Post: 05-27-2008, 05:42 AM -
ActionListener interface
By tsantana in forum New To JavaReplies: 2Last Post: 03-30-2008, 10:24 PM -
error stack when I try to execute my code
By paty in forum New To JavaReplies: 1Last Post: 08-02-2007, 08:32 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks