java

reading multiple files in a folder in java

hi, can any one help me . I want to read all the files in a folder through java. can any help me out???.. ...

How to do Unittests in Servlet-Applet scenario

How should I create & run unit-tests for a Java/Tomcat Servlet-Applet application? ...

What does List<?> mean in java generics

What does List<?> mean, does it mean simply a list of objects of unspecified type? Googling for the string <?> returns nothing useful (: ...

Java compile warnings with spring "Validator" classes

New to spring, we have a whole pile of validators that generate java warnings, I was able to hide them using the "@SuppressWarnings" annotation, however what is the proper way to sort this out? public class SignInValidator implements org.springframework.validation.Validator { @SuppressWarnings("unchecked") public boolea...

How to add a persistence unit in jndi for ejb modules

Hi! I am working on a simple ejb module, sample code where i am trying to implement CURD operation through a SOAP webservice. My problem is like this. I have a persistence unit defined in persistence.xml file. Here is the code for my implementation. The problem is that I cannot create the instance of PersistenceService class since, th...

How to get IzPack tocheck for an existing version of the software?

Hi, I have an application for which we use IzPack to create the installer. The installer is working fine in its current state, however, I need to add functionality that enables it to check whether an existing version of the software has been installed. I understand IzPack supports this out of the box using its CheckedHelloPanel, unfort...

Can't not use ListCellRenderer

I'm using Netbeans to develop my Java application.I want to display list of items with icons. I have use ListCellRenderer but it just display item, but not icon. Here is my code //Item class public class Item { private String title; private String imagePath; private ImageIcon image; //getter and setter} //ItemRenderer publ...

Why is passing a subclass to a bounded wildcard only allowed in certain places?

This following is from generics tutorials: Say class R extends S, public void addR(List<? extends S> s) { s.add(0, new R()); // Compile-time error! } You should be able to figure out why the code above is disallowed. The type of the second parameter to s.add() is ? extends S -- an unknown subtype of S. Since we don't know what ty...

Generating java core dump log file for applets in Linux

I have an applet that is crashing Firefox on Linux. Can anyone tell me how I can enable the java core dump log file for this applet and where the file would be generated? ...

Java book for programmer with intermediate experience

I am well aware of this previous question here and have heard great things about those books. I actually bought two of them, Effective Java and Java in a Nutshell as an early Christmas present. I am looking for a good Java book, or books, to further continue my understanding of Java from a recent college graduate point of view. I have ...

Collecting Return Values from Launched Threads? [latest Java]

I'm looking for the simplest, most straightforward way to implement the following: main starts and launches 3 threads all 3 tasks process and end in a resulting value (which I need to return somehow?) main waits (.join?) on each thread to ensure they have all 3 completed their task main somehow gets the value from each thread (3 values...

Convert RTF files to DOC

I generate a report in doc format using Jasper, Jasper uses JRRTFExporter to generate doc reports, but wen i try and compare doc reports using POI it throws exception stating some header issues. Is there any way to convert rtf to doc in jasper or any API available to convert rtf to doc? Please help! ...

Java MS Access Database Connection without Admin rights

For a JAVA project I am working on there is a requirement that I use a Microsoft Access Database running on a computer where I do not have administrative priveleges. So, I have the Access DB file all ready, and I started doing some research - but everywhere I look mentions the need to use the Admin Tools (or Control Panel) to "setup an ...

Wrong character encoding in dist jar generated with NetBeans

Hi, I finally wrote me little app. It's desktop app but it has embedded web server. When I lunched it from NetBeans everything is ok. When I lunch dist jar I have correct character encoding in GUI, but web server output is corrupted ("?" instead of national characters). I use NetBeans 6.7.1, jdk1.6.0_16, http server from Java 6 SE and ...

Java API to convert RTF file to Word document (97-2003 format)

Is there any Java API available which converts .rtf files to .doc file (97-2003) format? ...

JTextArea.copy() clipboard cleared when prorgam exits

I have a JDialog with a JTextArea component. This dialog shows the user what arguments to use when running the program to have it run the mode they just set up. I have a button on the dialog to copy the arguments to clipboard. This uses the copy() method on the JTextArea object. This works perfectly and the clipboard contains the correc...

Should I create additional configuration models or can I use a Properties object directly?

I have a small Java application which uses some configuration settings, which are saved between sessions. I started to create a Configuration class which provides the settings and can save and load itself to a Properties object. But because it's a very small application with few settings I asked myself, if I just could use a Properties...

Is it OK to change a model outside the Swing worker thread?

In a "serious" Java GUI app, you'll have models behind many of your GUI elements: A DocumentModel backing a JEditorPane, for example, or a ListModel behind a JList. We're always told not to make GUI changes from outside the Swing worker thread and given SwingUtilities.invoke...() for working around that. Fine, I can live with that! It's...

Is there a way to map an URL to another URL in Spring?

In Struts 1 you could have, in struts-config.xml, a declaration like: <action path="/first" forward="/second.do"> Is something similar also possible in Spring, or can I map an URL only to a controller? I am using Spring 2.5.x. I could off course map the URL to the same controller as: <bean id="urlMapping" class="org.springframework....

Inner class in interface vs in class

What is the difference between these two innerclass declarations? Also comment on advantages/disadvantages? case A: class within a class. public class Levels { static public class Items { public String value; public String path; public String getValue() { return value;} } } and case B: class within interface...