java

Parsing an Object into a String

Hi there I am looking to parse an Object I have into a String so that I can enter it's value into a textfield. Here is a little snippet. TFname is the name of the textfield Object value = list.getSelectedValues(); TFname.setText(parseObject(value)); //-- Here I pick up an error Where I pick up the error, I know it's because this isn'...

Recommended .NET PDF Renderer for multiple pages with form fields

We currently use TallComponents PDFKit.Net for rendering tedious state documents that have a number of form fields. Often we'll need to have a page that repeats many times within a single document. Most reports are 10 pages, with 3 unique template pages (pre formatted in Adobe), for example. We've worked with TallComponents to optimiz...

opensource network monitoring tools developed in java

Hi i want to know the best opensource network monitoring tool developed in java with very good support via forums and which should have the following features .. Fault and Alert mgmt Performance Poll graphs inventory mgmt config management ...

A colleague said don't use java.util.Vector anymore - why not?

Previously I would always have thought a Vector was good to use for non-descript objects when length was unknown. As far as I was aware I thought it was thread-safe too What would change that it shouldn't be used anymore, and what is the alternative? ...

General Exception in Java

Hi All, I am looking to throw a general Exception in Java. The "situation" is basically if an empty line is encountered, an exception is thrown and the blank line ignored. Now, I come from a C# background so I would just throw a normal Exception. In Java, is there one? I can't seem to find it. I know I could assert, but would this so...

java code for reading text

i need a sample code for this if text file is not empty then string s = first line of text of the text file. please help me out. ok not a homework question i am not looking for the solution just point me to the correct reference material. ...

argh - can't get spring to log sql

I'm researching spring for a possible switch to a spring stack. One of the things that I thought was cool was the ability for spring jdbc to log all the executed sql. So I put in log4j, set up a log4j.properties file. and no sql. here is the log4j.properties file: log4j.appender.stdout=org.apache.log4j.ConsoleAppe nder log4j.appende...

best opensource graph API to integrate with java

Suggest me a best opensource graph API to integrate with java application. Basically it collects and stores some data.This collected data should be drawn in a graph like mothly average of data flow , weekly average ...The API should support extensive graph types like bar chart,pie chart , custom chart etc., ...

Java Math(s) Parsing API

Following on from my previous question, I was wondering if anyone knew of any free (as in beer, as in freedom would be nice but not essential) math(s) parsing libraries for Java. I found one called Jep which used to be open-source (ie: written by the community), but now costs $300 upwards (is this even legal?). Any help appreciated! ...

syntax error on createCell

i'm getting a syntax error on row.createCell line Multiple markers at this line - Syntax error on token "createCell", = expected after this token - Syntax error on token(s), misplaced construct(s) this is the code HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("new sheet"); HSSFRow row = sheet.cr...

Jinput init's controllers with up and left as true

I tried using it on this simple code, and JInput makes the controller automatically go up and left! IT seeems that input.isControllerUp(Input.ANY_CONTROLLER) starts out as true! How can I fix this? import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.BasicGame; import org.newdawn.slick.Color; import org.newdawn.slick.Game...

Running ant build gives "package org.junit does not exist"

When I use a Java IDE to build projects (e.g. NetBeans) that have JUnit tests, they compile fine, but when I try to use ant outside of the IDE to run the build script, I get the error "package org.junit does not exist". ...

Casting objects in JRuby

Is there a way I can explicitly cast one Java object to another Java class from JRuby? Sometimes I want to be able to invoke SomeJavaClass#aMethod(MySuperClass) rather than SomeJavaClass#aMethod(MyClass) from JRuby. From Java, I'd do this: someJavaObject.aMethod( (MySuperClass) myObj ); but I didn't see a #cast ruby method or an...

Does Java Serialization work for cyclic references?

For example: Object A contains Object B that contains Object C that contains Object A. Will Object A serialize properly? Comment #9 here indicates that it does not work . In contrast, XStream indicates that it does handle cyclic references. ...

Where/how to store persistent data with tomcat ?

Where should I store persistent files in a Tomcat web app ? javax.servlet.context.tempdir is not feasible, it's erased when the app is redeployed/removed Don't want to use an absolute path in e.g. servlet init parameters Storing the files in a database is not an option ...

Java substring is dropping first character if zero

I am using the substring fuction in Java and what I am finding is if the first character in the substring is a zero, it is dropped from the new string. Is there a way to prevent this? Here is the code I am having issues with: ccode = actnum.substring(1,2); Both ccode and actnum are defined as strings. If more code is needed, plea...

java in-memory on-the-fly class compilation (and loading)

I want to revisit an old question of mine about in-memory "compilation" of classes. Since about 1/2 a year have passed since I asked (and was somewhat answered), I'd like to re-raise the issue and see if something new would come up (so no, I don't consider this a duplicate). The old question can be found here: http://stackoverflow.com/q...

Java SwingWorker hanging

I'm debugging some code that was written using a SwingWorker to perform a mix of numerical calculation and GUI update. The SwingWorker hangs with the following stack trace : Full thread dump Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing): "SwingWorker-pool-3-thread-4" prio=6 tid=0x07fd7c00 nid=0x143c waiting on condition [...

In-process SOAP service server for Java

OK, I am developing a program which will be deployed to lots of machines (Windows, Linux, AIX, z/Linux, openVMS, etc.). I want that application to contain a SOAP web service, but I don't want to bundle tomcat or run a separate service for the services (I want them in the same process as the rest of the application). Basically what I'm ...

Java auto boxing

I switched a project I'm working on over to maven and suddenly auto boxing seems to have broken. My IDE (NetBeans) complains on lines such as the one below with the error "Incompatible types" Integer order = 4; ...