java

Java Date Format for Locale

How can I find the DateFormat for a given Locale? ...

How do I set -Dfile.encoding within ant's build.xml?

I've got java source files with iso-8859-1 encoding. When I run ant, I get "warning: unmappable character for encoding UTF-8". I can avoid this if I run ant -Dfile.encoding=iso-8859-1 or add encoding="ISO-8859-1" to each javac statement. Is there a way to set the property globally within build.xml? <property name="file.encoding" valu...

What are good Java date-chooser Swing GUI widgets?

What are good Java Swing date-chooser components? So far I've only really found these 2: JCalendar - this one is pretty good as it uses the underlying look and feel. JXMonthView in the swingx project - not so good as it uses its own look and feel Both of these look a bit clunky when compared with some I've seen on web-pages. For exam...

Sim Based application

Hi I have to design a simple application which has to reside in the SIM card of a GSM mobile. But I dont have any idea how to get started. Till now I have only designed apps using J2ME. Do I need Java Card for SIM based app? Thanks in advance for the help. ...

How can I atomically "enqueue if free space OR dequeue then enqueue" for a Java queue / list?

I've got a requirement for a list in Java with a fixed capacity but which always allows threads to add items to the start. If it's full it should remove an item from the end to make space. No other process will remove items, but other processes will wish to iterate over the items. Is there something in the JDK which would allow me to ...

InputStream or Reader wrapper for progress reporting

So, I'm feeding file data to an API that takes a Reader, and I'd like a way to report progress. It seems like it should be straightforward to write a FilterInputStream implementation that wraps the FileInputStream, keeps track of the number of bytes read vs. the total file size, and fires some event (or, calls some update() method) to r...

Slow query in Java by JDBC but not in other systems (TOAD)

Hello i have a query to an Oracle System which involves a view which joins other tables by apliying an TO_NUMBER() to the tables primary key. If i do the query using TOAD the query is very fast (1 sec for 800 regs). If i do the same query in a java program by JDBC with a String literal (not a parametrized query), the time is good too. ...

Get http variable JSF

Hello everybody, I have a question about JSF and GET http request. How can I get a GET variable in bean managed by JSF ? I tried to use it but nothing is in the map. FacesContext.getCurrentInstance().getExternalContext().getRequestMap(); Thanks for your answers. ...

How do I start VisualVM with the JMXWS WS Connector (JSR-262)?

I have an Java application running in JBoss in which I have enabled JMX remote monitoring. This allows me to connect with tools such as jconsole and visualvm to monitor memory usage, cpu utilization, mbeans, and more. The server on which my application is running has restrictive port access though, which is why I am using the JSR-262 JMX...

java.lang.SecurityException: class "XYZ"'s signer information does not match signer information of other classes in the same package

I have an applet which runs in a browser and is called from Javascript. There are 2 classes: PortalLauncher and ParamSplitter and these are in the default package. Javascript calls a method in PortalLauncher which in turn calls a function in ParamSplitter. The applet is in a signed jar. This works most of the time. However, a few users ...

How Can I read a file with both ASCII and another encoding in Java cleanly?

I have a custom image file where the first block of data is ASCII meta data. I need to be able to read this ASCII meta-data part of the file with Java and know when it ends, and when the 'raw image data' in another encoding starts. I was thinking of reading all of the file into a byte[], and then somehow either start reading bytes out ...

overwrite content of textarea java

Hi, i appending text to text area for every sec i wanted to overwrite or clear the old text and i want write new data for every one sec how to do this in java? Thanks raksha ...

Fastest way to compare strings (literal and numerical)

I have a performance problem related to string comparison (in Java). I'm working on a project that needs to sort a huge list (a TableViewer in Eclipse). Anyway I've pinpointed the bottleneck down to the call to compareTo() for the string to be compared. Is there any way to optimize the performance of a string compare? I've searched and...

How can I detect the installed Sun JRE on Windows?

I tried googling the answer, but all I found was tips on how to detect Java from a browser or the very generic way of just starting Java and see if it runs, which introduces a possibly long delay in my application. (~ two seconds when started the very first time on my machine) I hope there is a faster way, if the following restrictions ...

How to achieve "scheduling" in Google App Engine

Know that either java-version or python-version it doesn't support threading or processes. So if I want to execute a small snippet periodically in GAE, is there any possibility? Oh, I'm just finding there is a document mentioned about it: http://code.google.com/appengine/docs/java/config/cron.html ...

XML-RPC error while running client

Exception in thread "Thread-4" java.lang.InstantiationError: org.apache.xmlrpc.XmlRpcRequest at org.apache.xmlrpc.XmlRpcRequestProcessor.decodeRequest(XmlRpcRequestProcessor.java:82) at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:143) at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139) at org.apa...

pull the data from SAP BW System and process in java

We have a requirement to develop an application that pulls the data from SAP BW system and display it on a Flex chart. The Flex guy wants the data in the XML format. Am the middleWare guy who sits in between the SAP BW and the flex. I need to pull the data from SAP BW system and feed the flex components in XML. Question: How do I need ...

ProxyServlet with SSL

I have some proxy servlet(link text): , and I want to make the connection(con A and con B on the diagram) to this servlet secure(with SSL). This proxy works under Maven Jetty Plugin. I have configured jetty to handle ssl request: <connector implementation="org.mortbay.jetty.security.SslSocketConnector"> <port>8443</port> <maxIdle...

Edit flash with Java

Is there any way to dynamically generate an swf file? Or insert variables after it's "compiled" to swf? Or insert variables to the fla and then compile it to swf? (I'm using flash lite 1.1 (and the flash is set to background) so i can't read anything from outside the swf file, that's why i need this) (I'd like to do this using java (...

running rmi client server in a different process... unbound exception

i need to write a RMI client/server application that the server is running in a different process. when i am running my code in the same process everything is working fine, but when trying to run the server code in a new Process using ProcessBuilder pb = new ProcessBuilder( "java", "-cp",...