java

Running Ant with JDK 1.6 on Mac OS X

I am having a problem running Ant with JDK 1.6 on Mac OS X. Even though Java application versions is set to Java SE 6 in OS X's Java Preference, executing java -version in Terminal also shows java version "1.6.0_07", Ant still seems to use JDK 1.5 to be using JDK 1.5 as it does not see JDK 1.6 classes when compiling my code. I understan...

Getting started with Web Services

I want to start developing some web services, I've had some courses that talked about them and read about them on my own. However I can't seem to know exactly where or how to begin with them. I mean, I've done some tutorials and the excercises from class but that still left me kind of not knowing how to begin. Is there anything you guys ...

Adding an image to a panel using Java AWT

I posted earlier about having a really messed up panel but fixed that by simply changing the layout (thank you to Charlie Martin for helping me). Now, I'm trying to add an image to a panel so I can add that panel to the frame. This is part of the class that I am messing around with. http://friendpaste.com/13zibFC4oVxCbm83500KVj This is...

stop while statment with messagebox java

I need to find a way to stop a while statement when a messagebox is closed in java. I am modifying a chat program, the server has no gui and listens with a while(true) statement. I am trying to find a way to close the server with out going into task manager and killing java.exe. I have little experience with java so some source code woul...

Simple Java library - output Oracle query to CSV?

Is there a simple Java library or approach that will take a SQL query and output the result to a CSV file? Update: I found there were a couple other related SO posts existing (1, 2) ...

Java Overloaded Methods

I am trying to use one file to create a menu in the command window. The user selects from those menu options. They are prompted to enter a number. The number is passed to two overloaded methods which determine if the number is an integer or a float. After the calculation is done the result is printed to the screen and the menu reappears....

How to get correct encoding?

Hi,I have utf-8 file which I want to read and display in my java program. In eclipse console(stdout) or in swing I'm getting question marks instead of correct characters. BufferedReader fr = new BufferedReader( new InputStreamReader( new FileInputStream(f),"UTF-8")); System.out.println(fr.rea...

Best method to create a new instance based on precondition.

Hi my question is this. Suppose you have an interface that defines how a converter would be implemented. This interface could have a method loadDocument() and another convert(). Now suppose we want to have multiple converters, ConvertHTML2DOC, ConvertXML2HTML e.t.c you get the idea. Suppose you get the two formats you need to convert in...

Does Java's floating point implementation still have the problems identified by Kahan?

I've read a few papers from Kahan tonight, and his famous rant against Java. Before I dive into the JVM spec, did anything change since the initial rant on this front? For example: setting rounding mode accessing the flags getting more precision for free ... ? Thanks, Nico. ...

Formatting orb tags in MVEL

How to remove the whitespace line generat by @code{}, @if{}, @foreach{}, @end{} ect Orb Tags in the result of MVEL 2.0 Templating ? ? ? ? ...

Max name length of variable or method in Java

Is there a max length for class/method/variable names in Java? the JLS doesn't seem to mention that. I know very long names are problematic anyway from code readability and maintainability perspective, but just out of curiosity is there a limitation (I guess class names might be limited by the file system maximal file name limitation). ...

Java: HTTP Post to create new "Product" in a Ruby on Rails application

Using the Apache HttpClient on android, how do I send data to a RESTfull Ruby on Rails app using HttpPost. This is my Controller: # POST /products def create @product = Product.new(params[:product]) respond_to do |format| if @product.save flash[:notice] = 'Product was successfully created.' format.html...

How to monitor the installation process through java program?

Hello all, I need help on keeping track of the Installation process through java code. Our installers are developed by using the InstallAnywhere. When the user clicks cancel button the Installer quits but does not leave the system in a cleaned state as before the installation. So kindly help me in tracking of the 'Cancel' button by the ...

java.lang.NoSuchMethodError: java.util.Properties.load (huh? why?)

I've built a Java application which executes correctly from my IDE (Netbeans). I have packaged the jar into a bundle for Mac OS (Leopard). If I run the application from the bundle or from the shell I get this error: java.lang.NoSuchMethodError: java.util.Properties.load(Ljava/io/Reader;)V I'm using java 1.5.0_16. Do you know why I...

How does spring framework assist in application development?

Guys, Am a bit confused here! how does spring framework assist in general development of an application? I use django framework and i can quickly explain to a layman how all parts fit together(Django, Python, templates, packages etc) to produce an excellent web application, but when i look at spring i get a bit lost! Am looking answers ...

splitting arrays

How do I partition an array into four sub arrays in Java? ...

Java Keylistener without window being open?

I'm trying to create an auto-clicker in Java(only language I know and I just learned Threads). I want to have the applet open in it's own window(not on a webpage), and I want to be able to start and stop the program with the spacebar without the window being selected so that I can use the auto-clicker on another program and be able to st...

What's the best tool for generating a parser in Java for my own language grammar?

I'm developing a small programming language based mostly of the C99 standard and I've already written a fairly decent lexer in java and now I'm looking to generate a Java Parser from the grammar. I know there's Bison, but that seems to only generate C code. I'm looking for a application that will allow me to input my grammar and create a...

Java: "Control" External Application

Is it possible to programmatically start an application from Java and then send commands to it and receive the program's output? I'm trying to realize this scenario: I want to access a website that uses lots of javascript and special html + css features -> the website isn't properly displayed in swt.browser or any of the other of the ...

Embedding Silverlight app in an Eclipse RCP

Does anyone has a good resource on embedding a Silverlight application in an Eclipse RCP application? Scenario is as follows: We have a third party application that we want to integrate into an already developed Eclipse RCP Application, and we don't want to redo anything. Also, I can't just start this as a second app but must be embed...