java

Sending a value from javascript to jsp (with jquery)

Hi, right now i have a jsp page that allows to sort some items, when is ready and a link is clicked a javascript function converts all the info into xml (text in a variable), after this i need to send this xml to the jsp page again, i tried putting the info in a hidden input and submiting the form, sending with $.post and a few more jque...

Developing apps for the nokia n73 in Java?

Hello, I'm trying to find out if it's possible to develop a key capturing application to analyse writing styles when using the SMS composer for the n73 using S60 2nd Edition, Feature Pack 3 SDK in Java? Originally, I thought that all Java applications would be sand-boxed making it difficult to call the native key capture functions avail...

"Dynamic" Casting in Java

Hullo all, Wondering if there are any Java hackers who can clue me in at to why the following doesn't work: public class Parent { public Parent copy() { Parent aCopy = new Parent(); ... return aCopy; } } public class ChildN extends Parent { ... } public class Driver { public static void main(Stri...

Java Object Reuse

Should Java Objects be reused as often as it can be reused ? Or should we reuse it only when they are "heavyweight", ie have OS resources associated with it ? All old articles on the internet talk about object reuse and object pooling as much as possible, but I have read recent articles that say new Object() is highly optimized now ( 10...

War-file deployment with shared resources

Consider the following example structure - Project - www - files + documents + html + images + scripts - WEB-INF * web.xml The documents folder needs to be a symlink or in some other way external from the war file because users will add and remove documents (throu...

How can I get the length of a JTextField's contents as the user types?

JTextField has a keyTyped event but it seems that at the time it fires the contents of the cell have not yet changed. Because of that .length() is always wrong if read here. There must be a simple way of getting the length as it appears to the user after a key stroke? ...

Corrupt file when using Java to download file

This problem seems to happen inconsistently. We are using a java applet to download a file from our site, which we store temporarily on the client's machine. Here is the code that we are using to save the file: URL targetUrl = new URL(urlForFile); InputStream content = (InputStream)targetUrl.getContent(); BufferedInputStream buffered...

How to parse a binary file with floats (Java generated) using Cocoa Touch?

Given the following Java code for generating a binary file: DataOutputStream out = new DataOutputStream(new FileOutputStream("foo.dat")); out.writeInt(1234); out.writeShort(30000); out.writeFloat(256.384f); I'm using the following Objective-C code and manage to parse the int and the short values: NSString *path = [[NSBundle mainBundl...

Where can I find the following classes in Java

Hi, I am a .NET dev learning Java. As a result, I understand all the fundamentals of programming like loops, variables, functions, etc. My biggest bottleneck is that I don't know my way around Java's packages like I do with .NET's. This is the reason for this thread - where do I find the following functionality in Java?: System.Diagno...

Should I do more JavaSE before jumping to JavaEE?

I'm almost finished with the book "Head First Java". The reason I'm studying this is I'm hoping to get a job developing with JavaEE someday. Now I'm thinking, should I go ahead and study EE (moving on to Head First Servlets and JSP) or should I spend more time with SE? Would it help? I'll go on and say directly that I want to learn EE in...

Working with large wsdl, can we trim it?

My webservice provider give me a large WSDL file, but we are going to use only a few function inside. I believe that the large WSDL have negative impact to the application performance. We use the webservice in client appliction, startup time and memory usage are issues. Large WSDL means that jax-ws will takes longer to do binding and w...

Anyone using short and byte primitive types, in real apps?

I have been programming in Java since 2004, mostly enterprise and web applications. But I have never used short or byte, other than a toy program just to know how these types work. Even in a for loop of 100 times, we usually go with int. And I don't remember if I have ever came across any code which made use of byte or short, other than ...

struts2: s:checkbox doesn't go on the same row with s:checkbox

Here's the .jsp code: <table> <s:iterator value="allAgents"> <tr> <td><s:property value="firstName" /></td> <td><s:property value="middleName" /></td> <td><s:property value="lastName" /></td> <td><s:checkbox name="ss"/></td> </tr> </s:iterator> </table> When rendered, the checkbox would occupy a whole row bel...

Learning Algorithm and Saving Data in Software

I'm coming from a web-development background and I am wondering how I would make a learning algorithm in Java/C++. Not so much the algorithm part, but making the program "remember" what it learned from the previous day. I would think something like saving a file, but I suspect their might be an easier way. Apologies if this question is j...

Is it possible to "add" to classpath dynamically in java?

Hi all, java -classpath ../classes;../jar;. parserTester How can i get the functionality in the above command programmatically? Like, is it possible to run as: java parserTester and get the same result? I tried using URLClassLoader but it modifies the classpath and does not add to it. Thanx! Thanks for the response Milhous. But tha...

Usefulness of JNI

I've been a java developer for a couple years and have heard that you can do some pretty useful and powerful things with JNI. I don't know if I just haven't needed to use it or if it isn't terribly relevant to me; but I have not had to touch it at all. I am wondering what the usefulness of this aspect of Java is. Examples would be grea...

where can i find Java JMF tutorial

I'd like to know about basic classes for playing video from webcam I'd also like to play with video buffers pixels where can i find a Java JMF tutorial that will help me achieve that? ...

Why might one also use a blank constructor?

I was reading some Java recently and came across something (an idiom?) new to me: in the program, classes with multiple constructors would also always include a blank constructor. For example: public class Genotype { private boolean bits[]; private int rating; private int length; private Random random; public Genotype() { ...

Customizable player avatar in a 2D Game

How can I have that functionality in my game through which the players can change their hairstyle, look, style of clothes, etc., and so whenever they wear a different item of clothing their avatar is updated with it. Should I: Have my designer create all possible combinations of armor, hairstyles, and faces as sprites (this could be a...

tutorials to learn access word documents(.doc) from java

Hi friends, Can anyone direct me to good tutorials and sample programs to learn apache poi to access MS word .doc documents from java. with thanks, Manu ...