java

Looking for an open-source Java Help API

I'm working on an application written in Java. I want to allow the user to read the "Help" of the application. I'm basically looking for a Java free open-source equivalent for Microsoft chm. I'd like it to have support for "Find" and tree-like structures. I am willing to write one component myself but I was wondering if existent altern...

Convert iCal to HTML or plaintext in Java

I'm looking for a Java API to convert ICS (aka iCal) attachments to nicely formatted HTML or plaintext for display purposes. Ideally, it would be able to handle: Converting dates to a specified timezone. Expanding recurrence patterns into human readable sentences. Multiple VCALENDAR records in a single file. I'm looking at iCal4j, wh...

wsdl java import problem

import com.premiereconnect.premconn.FaxNumberAvailableListRequest; import com.premiereconnect.premconn.FaxNumberAvailableListResult; import com.premiereconnect.premconn.GroupListResult; import com.premiereconnect.premconn.UserCreateRequest; import com.premiereconnect.premconn.UserCreateResult; import com.premiereconnect.premconn.UserUpda...

Hibernate Example OneToMany with compositeKey

Can you give me an example of a Hibernate mapping for the following situation: Parent table(foo) with a simple primary key (foo_id) child table(bar) with a composite key consisting of a> Foreign key to parent table (foo_id) b> key(item) of type string There is one parent to many child The Parent class will have a list of Child objects...

How to change default stop edit behavior in jtable

When you edit a cell in an jtable the value is made permanent only if the focus is changed or if one hits enter (for example if you change the cell value from "abc" to "xyz" and close the window the edit is lost). How do i make the edit permanent when the user stops editing? I guess we have to update the cell value as the cell value ...

Is it possible to specify which network interface for a JVM ( or IDE ) to use

The situation goes like this, I have two network interfaces in my macbook pro. One is a statically defined Ethernet interface and the other one is a DHCP configured wireless interface. I am trying to figure out how to configure a specific java project to use my statically wired interface only and not simply pick the first one in the lis...

Converting Symbols, Accent Letters to English Alphabet.

Dear friends, The problem is that, as you know, there are thousands of characters in the Unicode chart and I want to convert all the similar characters to the letters which are in English alphabet. For instance here are a few conversions: ҥ->H Ѷ->V Ȳ->Y Ǭ->O Ƈ->C tђє Ŧค๓เℓy --> the Family ... and I saw that there are more than 20 v...

iBATOR classPathEntry, can it be set as relative to the project?

When following this tutorial the one thing I really have a question on is the classPathEntry: http://blog.agdunn.net/?p=313 Notice his entry is hard wired to the full path of the mysql-connector jar: Is there a way to specify the project root as a variable in this type of situation? example: Thanks! ...

Is there any difference between these two statements?

float ff = 1.2f; Float fo = new Float(1.2f); double fg = 3.2d; Double fh = new Double(2.1d); Can I use '=' between the (1) and (3) or between the (2) and (4)?? ...

Validating multiple forms on one page using Spring Web Flow and JSF

I'm trying to use JSF to validate two different forms in Spring Web Flows. The problem is that validateAllOnClick seems to fire EVERY clientside validator on the page. Setting processIds to the form I want to validate's ID, or input ID, or validator ID just causes none of the client side validators to fire if I also remove validateALlO...

What's the quickest way to play with GWT for someone with almost no spare time?

I think the subject pretty much covers it. I'm not a web programmer (I am a programmer), I'd like to write some play web apps, I don't really have a lot of spare time. So what's the quickest way to get up and running to play around with GWT? ...

Junit test case for wrapper class

I have a Java class that simply extends a library class and calls a method of its parent with a default parameter. How do I write a Junit test for that? A MockObjectTestCase is good too. Here is an example of what I'm talking about: public class ResourceBundleMessageSource { public String getMessage(String key, Object[] objects, Loca...

What free JVM implementation has the best PermGen handling?

I'm running Tomcat6 in Sun's JRE6 and every couple deploys I get OutOfMemoryException: PermGen. I've done the Googling of PermGen solutions and tried many fixes. None work. I read a lot of good things about Oracle's JRockit and how its PermGen allocation can be gigs in size (compare to Sun's 128M) and while it doesn't solve the problem, ...

Is there any justifiable reason to use new and a constructor on a number class in Java?

Is there any justifiable reason to in Java something like Long l = new Long(SOME_CONSTANT) This creates an extra object and is tagged by FindBugs, and is obviously a bad practice. My question is whether there is ever a good reason to do so? I previously asked this about String constructors and got a good answer, but that answer does...

Most efficient idiom to read one integer only from a file?

In trying to resolve Facebook's Puzzle "Hoppity Hop", http://www.facebook.com/careers/puzzles.php?puzzle_id=7, I'm reading one integer only from a file. I'm wondering if this is the most efficient mechanism to do this? private static int readSoleInteger(String path) throws IOException { BufferedReader buffer = null; int integer = 0; ...

NullPointerException With Quartz & Spring

I'm using the Spring Quartz integration, and every time I try to shut down Tomcat, the Quartz processes fail to shut down. This is the stack trace: Exception in thread "org.springframework.scheduling.quartz.SchedulerFactoryBean#0_QuartzSchedulerThread" java.lang.NullPointerException at org.apache.commons.logging.LogFactory...

How do you effectively add components to a swing panel with a background image?

I have a JPanel onto which I'm trying to add some buttons. I have a bitmap background image onto which I'm supposed to draw the buttons. I have images for all the buttons. I need the background to scale with the buttons and the spacing to be correct. Is there a clean way to do this or is this going to be painful? Thanks ...

Eclipse Stacktrace System.err problem

All of a sudden my printStackTrace's stopped printing anything. When I give it a different output stream to print to it works (like e.printStackTrace(System.out)) but obviously I would like to get it figured out. ...

How can I edit a jpg image through Java?

I have loaded a jpg image in which I want to draw letters and circles, given a x,y coordinate. I have been trying to figure out the paintIcon of the ImageIcon class public void paintIcon(Component c, Graphics g, int x, int y) Does this method allow me to edit jpg ima...

How to support both HTTP and HTTPS channels in Flex/BlazeDS?

I've been trying to find the right configuration for supporting both http/s requests in a Flex app. I've read all the docs and they allude to doing something like the following: <default-channels> <channel ref="my-secure-amf"> <serialization> <log-property-errors>true</log-property-errors> </serialization> </channel> ...