renameTo() problem second part

I would like to submit this again;to restate: I have the
code for a applet which will rename a directory when a
button is pushed. I believe the problem is in the action
event performer which is the last part. Ragnar thought
I was going to input from the command line but this is
not the way I meant. The button does work and readout
of the action but no action is performed to rename the
directory. This ends restatement. This time I uploaded the
.java file to
Ragnar answer the first part, perhaps he can try again;
the suggestion he gave did not solve the problem.
Who is Participating?
Whenever an applet tries to access local resources or connect to a machine that is not
the one that has served it, signing is required.

Info on the security model: 

Info on signing:

You extended Frame when you wrote your prog. as an application.
-> no security problem, file accesses are OK

To write an applet, you extend java.applet.Applet. With an applet, file accesses are not
permitted, except if you sign it (see above).

Multiple inheritance does not exist in Java. An interface simply defines a set of method signatures your class has to implement. They don't have a default implementation.
If you write:

public class Test extends AClass implements AnInterface {

all the methods of AnInterface have to be present in the code of Test, but you have to
implement them yourself, you are not inheriting any default implementation like in class

Your users only need the classes(.class) you have developed in order to run the app. as
well a Java virtual machine. The users should consult their machine vendor (HP, DEC, etc.)
in order to get one (for free). If MyClass is the name of the '.class' that contains the main()
of the app., users will typically type:

java MyClass

to run the application. I guess you should have some doc. with the IDE that explains you
how to distribute what you have created.
If you can repeat your original question and describe the problem exactly it would be helpfull.
johnh619Author Commented:
Edited text of question
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Are you signing the applet? If you don't do it, you will not be able to rename a directory,
which is a local resource and is outside of the Java sandbox.
johnh619Author Commented:
Fontaine I uploaded a file to
baywooddr/ and I copied part of it. I found a renameTo example
and the guy had put the renameTo method in the system.out.printlin parentheses. I did not know I could do that
but it works that way. I really dont know about signing it
and I will have to look that up. The next problem I resubmitted
after I got this part working. I compiled it and put it in a
html page and it would not start properly. I thought maybe it
should have more work in the applet part about standalone
programs. So I guess I might email you again later after I
read up on this signing idea. Thanks
I also uploaded to

johnh619Author Commented:
When you signing the applet did you mean like a method signature?
I looked up signature and found this table saying
and so on
this is a method signature I believe. I did not see reference
to signing an applet in my books.
Here is a link that provides you with information on this:

With an application, you can access local resources such as files, connect to an arbitrary
server, i.e. do all you would do with another language such as C++. An applet however,
has some restrictions that prevent bad guys to do bad jokes such as grab confidential
data from your disk, or whatever. An applet can't connect to an arbitrary host, but only
the machine that has served the applet and does not have access to local resources.
To gain these accesses, you need to sign the applet, what opens the security sandbox
the applet works in. This page explains you that:

Hi John,

       Yes your program works if you do not run it from the browser. As fontaine said ,You need to sign the Applet before you can load in the browser. I converted your program to Applet instead of running as an application (Frame) if that is what you are trying by doing Standalone??? . It works fine when run from appletviewer but will and does give Security exceptions when the buttons are clicked in browser, since browsers have security restrictions that can not do operations on the Harddisk (local resources) .

           The applet will work after you sign it, which eases the security of the browsers.

has some info on Signing .
johnh619Author Commented:
I guess also I dont understand the idea of interfaces also.
It seems if I start with extend from frame then I do not get
the error message saying the type File was in the declarations
or top of the program. If I entend applet I do get an error
at line
File f1= new file ("path")
saying that File was not recognized. I am presently reading
about multiple inheritance and it says I can have an interface
made of methods which will let me inherit from applet and
Frame or should it be applet and io classes.
In any case I shall read the file about signing which I did not
know existed until you told me. Perhaps then this may be the
end of this questioning.
johnh619Author Commented:
I can see now since reading up on signing that it is no wonder
that my applet would not run in the browser since it involved
file security. I of course at present think that making it a
stand alone java applet would be easier than trying to get a
signing certicate. I am a disabled veteran and this is my hobby
and is not a money making adventure. So now I can see how the
standalone idea becomes interesting. But really I am assuming
by standalone that they mean the applet does not require a
browser. I have a copy of java cafe and jbuilder and they support
creating an application I believe so I will try to make the
standalone applcation. Or I could let my user download a copy
of java.exe I suppose since it is only 5120 bytes. I am right
about that?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.