java

Extracting IPTC/EXIF data from tif files in using Java

The system I'm working on has a feature to extract metadata from JPEG files using the com.drew.metadata package. http://www.drewnoakes.com/code/exif/javadoc/ However that is limited to JPEG files, and now a customer has asked about extracting IPTC from TIF, and possibly other image formats. Does anyone know about similar APIs to Drew No...

Cannot create Java Webservice in Eclipse

Hi, I would like to create a Web Service in Eclipse. I already wrote a class and generated a WSDL file from it with Java2WSDL. I started a new "Dynamic Web Project" and added the axis2 facet to it. After that I wanted to create a new "Web Service" project. When I now select my WSDL file and click on "Finish" I get the following error: ...

Unit test helper methods?

Hi, I have classes which prviously had massive methods so i subdivided the work of this method into 'helper' methods. These helper methods are declared private to enforce encapsulation - however I want to unit test the big public methods, is it good to unit test the helper methods too as if one of them fail the public method that calls i...

JSF 1.2: valueChangeListener event not returning newly selected value

I have this backing bean: public class PageBean { private List<SelectItem> selectPages; private List<SelectItem> selectRowsPerPage; private String selectedPage; private String selectedRowsPerPage; private int pages = 0; // getter methods public boolean getRender() { boolean rendered = pages > 0? true: false; retu...

Is this image segmentation?

I've been writing a Java program that aides in cutting and working with sprites, such as CSS sprites. The main idea is that the image is segmented into subregions, so the software understands the "spritesheet" is composed of multiple sprites. The algorithm I developed works by scanning horizontal (x) and vertical (y) axes for breaks, ba...

Python vs. Java -- Which would you pick to do concurrent programming and why?

Also, if not python or java, then would you more generally pick a statically-typed language or a dynamic-type language? ...

Eclipse CVS ignores .class files -- how can I turn that off?

I would like to commit new .class files into CVS via Eclipse, but these files get ignored, and I'm not sure where to turn that off. The Preferences windows a section for doing this, but .class isn't listed. ...

Track process-ids of sub-/child-processes?

Hi, I need to execute and terminate/abort different shell scripts from inside Java (>= 1.5; ProcessBuilder). With the standard java mechanisms I am only able to kill the main process used for the shell script execution. When this shell script starts other processes (for instance ./foo.sh &; ./bar.sh &) then there processes are still run...

Is there a Java package to handle building URLs?

What I'm looking for specifically is some code in Java that will take a Map object and convert it into a query string that I can append to a URL I return. I'm sure there's a library that does this and much more, but I can't find it with a quick Google search. Anyone know of one that will do this? ...

HashMap with StringKey problem?

I have a List of Foo Objects. If a name appears multiple times, I want to do something to the first Item with that name. HashMap<String, Foo> map = new HashMap<String, Foo>(); for (Foo bar: this.FooList) { if (!map.containsKey(bar.getName())) { map.put(bar.getName(), bar); } else { map.get(bar.getName...

Cocoa class launched from JNI

I currently have code that makes a call from java into my cocoa app using JNI, in the JNI function on the cocoa side I create a new thread and assign my NSApp delegate like the main function would do. Here is the code I am using in a dummy class that creates my real class: @implementation MenuLauncher - (void)run { NSAutoreleasePo...

Access problem in java

I am working with a 3rd party framework and it turns out I need to wrap some of its objects as a delegate to one of my classes. class Foo { // 3rd party class. protected void method() {} } class FooWrapper extends Foo { private Foo mDelegate; public FooWrapper(Foo inDelegate) { mDelegate = inDelegate; } pr...

Better Performance: WMI vs SNMP?

What has better performance under Windows for retrieving stats like CPU/Memory/Disk usage, etc.? WMI or SNMP? Thanks, Steve ...

Finding Date Difference

What's the efficient way of finding say if a date is 5 days earlier than another day? Do I need to parse both days using a particular SimpleDateFormat first before I compare? ...

OpenOffice UNO time-out?

I'm using OpenOffice (headless) to analyse (page count, title, etc.) some files from a Java application using the UNO API. However, OpenOffice file loading can last more than 1 minute, and that's not acceptable in my case. Is there any way to set a short time-out either at the UNO level or (even better) at the OpenOffice level? ...

Upgrading to JUnit4 and keeping legacy JUnit 3 tests and test suites by running them together

I was surprised not to find the answer so far. If I am missing something basic I will be more than happy to know that. There is a large legacy code base that was upgraded to Java 6 (from 1.4). Large number of JUnit 3 tests are present in the code and are organized into test suite that runs successfully with JUnit 4 default runner in Ecl...

Auto complete textbox in Java Swing

Is there any good ready made Java Swing component that can be used to implement auto complete textbox? ...

How can I programmatically extract a preview image - like the first frame - from an FLV file in Java?

Updated: Since my original request appears to be almost impossible, what's the next simplest solution? Invoke the swftools app? Make a JNI call to the ffmpeg lib? Original: This is related to "how to extract flash frames programmatically" but I am constrained to Java libraries only (and no JNI calls to C please). This also implies no ...

Java GridLayout

Is there a way to add elements to a gridlayout that adds them horizontally instead of vertically? Basically i want to fill up an entire row with elements before it begins with the next. Hope i made my question clear. ...

Void, value, or other?

Hi, all. I'm working on a spaghetti monster (unfortunately not of the flying variety), and I've got a question about proper design. I'm in the process of taking a gigantic static Java method that returns an object and splitting it into reusable (and readable) components. Right now, the method reads an XML document, and then appends su...