|
|
I don't think anyone is likely to download something like this without more information. Please try and clarify the problem you are having, if necessary show some of the code that does not work.
It's time for a new signature.
|
|
|
|
|
Hello Friends
Whenever I used to run applets It founds the installed java from Program files and runs the applet in browser.Now,I deleted the java from Program files and copy a existing JRE to another Location in some cache folder.Now How my applet will find out that java is at the cache folder and then it makes applet to run.
Any Ideas??
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
I would guess that Java uses some registry key to locate itself, which is set during installation. Take a look at HKLM\Software in your registry to find entries with the path of the original run time and modify them to your new path. If this still does not work then you may need to reinstall in the default location.
It's time for a new signature.
|
|
|
|
|
Hello
Thanks for your reply.Actually to change registery through java script uses ActiveX that is not good practice for Browsers like Mozilla.
So,is there any way to set classpath through java script so that applet looks for java.exe in that folder only.
Thanks & Regards
Yogesh
|
|
|
|
|
yogeshs wrote: So,is there any way to set classpath through java script so that applet looks for java.exe in that folder only.
The classpath does not determine which java.exe is used. If you do not specify a particular location for java, it will use the path if it is an application, or the registered java plugin if it is a browser/applet. Once java starts, it uses a bootstrap classpath to load up the JVM, then uses the classpath to run the application/applet. For an application, you can specify the classpath to use when you start java. For an applet, it will use the default classpath.
As far as I am aware, you cannot use javascript to override either the version of java used for the applet, or the classpath used. That would be a fairly major security hole as it would allow malicious code to replace classes. ActiveX allows you to do things like that on IE which is why many companies have a policy in place to restrict which ActiveX controls can be run, and only trused sites are allowed to run them.
|
|
|
|
|
yogeshs wrote: Thanks for your reply.Actually to change registery through java script uses ActiveX that is not good practice for Browsers like Mozilla.
I think in reality browsers will not let you do this at all.
yogeshs wrote: So,is there any way to set classpath through java script so that applet looks for java.exe in that folder only.
No idea, that's a browser/javascript question.
I think maybe David has answered the question more fully.
It's time for a new signature.
|
|
|
|
|
This question has been answered before, a week or two ago. Here is the answer given then:
If it is an application then you can simply include the JRE in a directory along with your application distribution and then run the application from that. The advantage of this is that you know which version of the JRE your application will run against, rather than being at the mercy of whichever random JRE happens to be installed as the default on the target machine. There is no need for any installation process or registration, you can copy the JRE directory and then point your application at this and away you go.
An applet is a different matter. If you want to run the applet from within a browser, then that browser must have a Java plug-in of the correct version installed and enabled. There is no way the applet can do this automatically. Normally, I would expect the browser to prompt the user with a message, something like "A required plug-in is missing for this page". In this case, the JRE does have to be properly installed and registered, and you cannot simply copy it over to the other machine.
|
|
|
|
|
Thanks A lot guys for all your valuable reply and my confusion is also gone now with this issue.
Regards
Yogesh
|
|
|
|
|
|
Do you have a real question?
It's time for a new signature.
|
|
|
|
|
'hello corinna' contains a secret message and he needs the codz to find out what it is. Sheesh, do I have to tell you everything?
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
baddddddddddddddddddddddddddddddddddd
|
|
|
|
|
Hello Friends
I am loadina jpeg image to bufferImage by using ImageIO.read(new File("sample.jpg"));
But as size of Image file crosses around 120KB then it doesnt read.
Is there any other way to read large image file Using ImageIO or any other way to load into BufferedImage.
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
yogeshs wrote: But as size of Image file crosses around 120KB then it doesnt read.
120Kb does not seem very large for this type of file. What do you mean exactly when you say "doesn't read"? Do you get an exception, error message, program crash etc? Try and provide some more useful information surrounding the problem, if necessary add some debug code to your program.
It's time for a new signature.
|
|
|
|
|
Hello Sir
When I load then file of size more than 120kb then program crash.
BufferedImage textureImage = ImageIO.read(new File(imageFileName));
int flags = TextureLoader.BY_REFERENCE ;
flags |= TextureLoader.GENERATE_MIPMAP;
TextureLoader textureLoader = new TextureLoader(textureImage, flags);
Texture texture = textureLoader.getTexture();
currentAppearance.setTexture(texture);
Regards
Yogesh
|
|
|
|
|
yogeshs wrote: When I load then file of size more than 120kb then program crash.
Well I tried loading a file that is 791Kb with no problem. As I said earlier you need to identify exactly where it is crashing in order to find out why. Either add some debug code or run it through the debugger until something fails.
It's time for a new signature.
|
|
|
|
|
I'm calling a Java bean from my servlet which brings a database object then this object is supposed to pass to a jsp file showing database contents . This is done by forwarding request Dispatcher. But it does not show any results. i do'nt know whether it is getting any database object or not it does not show any result. Databse is in MySql made in PhpMyAdmin.
|
|
|
|
|
First help yourself.
Put some logging into yor code at each decision point - such as before you send a request to the DB or after the response is retrieved and check what the state of your data is.
When you find some code you think should work but doesn't, post that so we can laugh help you.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
Are you receiving any error messages? If so why don't you post them here. Otherwise if you can post the bit of code that is involved maybe someone can spot what the issue is.
|
|
|
|
|
how to extract the data from a .hdf file
|
|
|
|
|
indseelan wrote: how to extract the data from a .hdf file
The usual method is to read the file and then extract the data according to the structure of the file. Take a look at the documentation for .HDF files[^].
It's time for a new signature.
|
|
|
|
|
lets say...
Hashtable ht = new Hashtable <integer, integer="">();
ht.put(1, 1);
//Now i want to increase the value by 1, is there any way doing it better than:
Integer IntNumber = ht.get(1);
IntNumber++;
ht.put(1 ,IntNumber);
|
|
|
|
|
You don't need to call .put on the hashmap to update its objects. You could just get the object and change its value. Just make sure you never assign a new value in the obtained object from the .get method on the Hashmap. So the below will fail:
<br />
Integer myInt = myHashmap.get(new Integer(1));<br />
myInt = new Integer(4);<br />
While something like this will work:
<br />
class MyInt {<br />
private int m_MyInt;<br />
....more code ...<br />
<br />
public void increment( int by ) {<br />
m_MyInt += by;<br />
}<br />
}<br />
<br />
... a lot more code ...<br />
<br />
HashMap myMap = ....
<br />
((MyInt) myMap.get(new Integer(1))).increment(1);<br />
|
|
|
|
|
This isn't really a restriction of Hashtable. If your Hashtable contains a mutable object then you can update that object in situ with no problem, no need to do another put to ht. But, if the object is immutable then you cannot update it. You need to create a new value and put this to ht.
Things are a little more complicated in your case, because you also have autoboxing going on, which means that you are implicitly swapping between an Integer object and an integer primitive at various points in your code, so a new object is being created and will need to be put back into the Hashtable. But basically, it boils down to the fact that Integer is immutable.
|
|
|
|