|
Just to be clear about this: you are saying that when you call clone() on java.util.ArrayList you get a compilation error, "The method clone() from the type ArrayList is not visible". Is that what you are saying? That sounds rather odd to me.
Perhaps you could post a small snippet of code which illustrates your problem.
|
|
|
|
|
To clone a string variable, do I have to use the clone method?
Thanks.
|
|
|
|
|
String is not Cloneable, so you cannot call clone() on a String object as it is a protected method.
String is immutable so it is safe to set the value from one instance to another:
myNewObject.name = myOldObject.name;
|
|
|
|
|
Hello there,
We have this module at work who nobody knows where the source code is.
It was behaving erratically on certain scenarios so i decided to decompile it (using DJ Java decompiler which btw works wonderfully) and found the problem line.
Now the how to fix it, i can think of 2 ways:
1) I decompile everything, change the line and recompile
The module is pretty large in amount of classes and submodules. I dont really feel confident that i can recompile everything right.
2) Editing the .class file somehow. Now i grabbed a class file editor that showed me bytecode, the method names and the variables declared in it, but no real way to edit a line out (or maybe hardcode a variable somehow).
So basically i am asking for advice on option #2 or maybe some other option i am unaware of. Thanks
|
|
|
|
|
Option #2 is fine if you really understand the structure of the class file but it is so prone to errors that I would not recommend it for a commercial or business application. You would be much safer in recreating the source code and rebuilding the application from that. This is the second such question I've seen today; I would suggest a better use of source control systems for your company.
It's time for a new signature.
|
|
|
|
|
I'm totally agreed with you. If you don't have a better idea about the project/application structure better to take the second option. Patching the code like this is real headache in most of the cases.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I think this could help you:
First, take out the Java source code for that particular class using DJ de-compiler and save it as '.java' file to a separate location with the same name & in the same package. For same package you will have to create empty folders as per the desired package.
Make the change you want into the Java code using any text editor or IDE. If you use IDE like eclipse, set the classes and jars which are available in that application into the classpath.
Find out the JDK by which the original class file was compiled. In case of jar file, the JDK version could be found in the MENIFEST file. You will have to compile your new code using the same JDK.
Generate the classfile either by IDE or by javac command from the JDK used in creating original class file.
Keep a backup of the original jar file.
Open the original jar file into Winrar or Winzip such that it shows the complete folder structure of the jar file. Open the folder in which the original class file is present. Delete the original class file and insert the new generated class file in its place. Close the Winzip/ Winrar application.
You are done! keep this new jar in place of the original jar and enjoy.
~UJ
UJ, the Power Builder.
|
|
|
|
|
Sir,
I'm studying computer science engineering course as a degree and i now entered into last semester of my course so i had a mini project and a major project to be done so I'm looking for the ideas which must be new unique but realized that it's not possible so I'm hoping that anyone of this community will help me by giving the ideas to implement as a mini and major project (both differ in their structure of course ) so please give me some suggestions for my development
Thanking you sir,
-
Sudhir
|
|
|
|
|
Well, in 1972-73 I completed a project on nonlinear optimization and another on solution of nonlinear partial differential equations. Then, in 1973 I selected a project on predicting the critical states of hydrocarbon mixtures and finished it in 1975. Then in 1976 I selected a project on automated control of oil fields.
It may seem sort of odd, but I don't recall anyone helping me pick those, other than the professors who needed to approve them anyway. As I recall we were told that if we didn't understand the subject areas enough to select a decent project, then we obviously weren't prepared to graduate.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
But sir I'm in programming area and i can apply anywhere i want but I'm not getting where i should implement
|
|
|
|
|
Go for a walk, look around you and consider all the issues and problems you see. Now think how you could apply a computerised solution to one of them and implement it.
As an alternative go and read the Quick Answers forum, there is a wealth of questions asking for people to write code. Anything from matrix multiplication to a train reservation system for Indian Railways.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: Go for a walk, look around you and consider all the issues and problems you see. Now think how you could apply a computerised solution to one of them and implement it.
How about have a discussion with a person who has an interest on researches and stuff. It's really helpful to find lots of new ideas.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
And why are you telling me this also?
It's time for a new signature.
|
|
|
|
|
Hello Friends
I am creating a class extends from JFrame and in his constructor adding jPanel And I tried to change Background color of frame by using jPanel.setBackGround(Color.WHITE).
It is setting white but just again it sets back to Black.
How can I set to White?
Any Ideas?
Thanks
Yogesh
|
|
|
|
|
Well I followed your logic and it didn't override. The only black I see if I enlarge my frame but this is normal because the components are being redrawn to the new size. Code will really help.
|
|
|
|
|
After adding buttons and all I am adding canvas to it also (from java3d canvas3D).
That is making it black actually.I tried by commenting that part and its comng White.So I tried by changing the canvas color to White but still I face the same prob tht it appears white foe a second and again Black.
AnyWay,Thx for ur Reply.
Regards
Yogesh
|
|
|
|
|
Hi All, I am working on a project where i have to provide the option for cut, copy, select all and paste. Here i am creating the shape objects in the canvas and thus want to perform cut copy operation on these shape objects. Can I have the sample code for doing so.??
Thanks
|
|
|
|
|
Why have you reposted the same question again? I have already given you an answer below, please try and read the link I posted for you.
It's time for a new signature.
|
|
|
|
|
As Richard already pointed out, you won't get the full code for what you ask. If you really want people to work for you, you'll need to hire somebody and pay him (for instance on rentacoder).
But if you are willing to do your work yourself, we can always help by answering specific questions.
Anyway, your question is totally vague because we have no clue about which technology you are using for the rendering.
|
|
|
|
|
Hi All, I am working on a project where i have to provide the option for cut, copy, select all and paste. Here i am creating the shape objects in the canvas and thus want to perform cut copy operation on these shape objects. Can I have the sample code for doing so.?? Thanks
Thanks & Regards
|
|
|
|
|
bensalah wrote: Can I have the sample code for doing so.?
No, you have to write it yourself. Or you could use the ubiquitous Google[^].
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: bensalah wrote:
Can I have the sample code for doing so.?
No, you have to write it yourself. Or you could use the ubiquitous Google[^].
Or at least the forum. I don't think that anyone wants to write codes for you.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Why are you telling me this?
It's time for a new signature.
|
|
|
|
|
Dear all,
I developed a web application and it is working fine, except for one issue. The application includes uploading files from a JSP to my servlet, and the issue is that i would like to have a limit for the uploaded files on the client side (before actually uploading it).
I investigated alot and found some ways like changing my JSPs to PHPs, which is not feasable for my application. I would also like to add that using the Flash component ("<object>") for uploading is not feasable also at this time. Using ActiveX does not work also (for some security issues in javascript, it can not access the system information, also ActiveX works only on IE).
I would like to add that I have my application running on Oracle application Server, JSPs for displaying the forms, MultiPart Java API for getting the form input values and files to my servlet and everything is developed in JAVA.
I would like some help to solve this problem, either by limiting the file size or the limiting the whole request size sent to the servlet.
Thanks in advance and I really appreciate your help.
|
|
|
|
|
Please post your question in ONE forum only.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|