java

Disabling compile-time dependency checking when compiling Java classes

Consider the following two Java classes: a.) class Test { void foo(Object foobar) { } } b.) class Test { void foo(pkg.not.in.classpath.FooBar foobar) { } } Furthermore, assume that pkg.not.in.classpath.FooBar is not found in the classpath. The first class will compile fine using the standard javac. However, the second class won't c...

cascade on many-to-one association in hibernate

Hello good fellas!i'm a bit confused about something right now about hibernate property.I have a parent class that doesn't need to browse it's child for now , eg the type of table that just hold information (id| currency | description) so in the mapping file of the parent i ignore the set tag. in the child class i have reference to the p...

Attach an object to the view platform in Java3D

Hello, In my Java3D application, I have a movable viewing platform (thanks to "OrbitBehavior" and "KeyNavigatorBehavior" behaviors for example) so I can change my point of view to the scene. Now, I would like to add an object which is "static" over my view, i.e. always viewed the same way when I move my view (for example, like the gun o...

Why not run a server side app with daylight saving time enabled?

I've implemented a server side application that records timestamps when records are created and updated. The app assumes that the server clock does not have daylight saving time enabled, (a) because I've read this is best practise and (b) because I imagine it would be tricky (if not impossible) to handle the ambiguities that occur, e.g. ...

Java: StringBuilder, static method and possible synchronization issues

Is it possible for code like this to be not thread safe? It is a static method and we are using an local instance of stringbuilder. I guess the input strings might be held by other objects? public static String cat(final String ... strings) { ... ... final StringBuilder sb = new StringBuilder(totLength); for (int i = ...

How to create an image map using Java Swing?

I need to make an image map using Swing that displays a background image, and then when the mouse hovers over (or clicks) specific hotspots, I need to pop up a 'zoomed-in' image and have it display. I was thinking of extending JPanel to include an image reference and have that drawn thru the paintComponent(g) method. This part I have d...

Resource for learning Java Graphics

What do you think is the best resource for learning Java Graphics? (I would like a book but any good websites are also welcome). ...

Maintainability of Java annotations?

My project is slowly implementing Java annotations. Half of the developers - myself included - find that doing anything complex with annotations seems to add to our overall maintenance burden. The other half of the team thinks they're the bee's knees. What's your real-world experience with teams of developers being able to maintain an...

strange issue with JPA

Hello everyone, I have an strange issue here. I´ve got a JSF page which calls a webservice, in that call a Load entity is created. After that from the page I insert some Files, Load has a relation 1--> N with the files. After that I call the webservice to create a timer for making a few task with those services. If I do that way JPA ...

Android: Can't figure how to use setImeActionLabel

What I want to do is change the default "Done" label that appears in the virtual keyboard. Here's what I've tried without any luck: mSearchInput.setImeOptions(EditorInfo.IME_ACTION_DONE); mSearchInput.setImeActionLabel(getString(R.string.search_action_label), EditorInfo.IME_ACTION_DONE); I am able, however, to handle a click on that b...

How should I name my class, functions, member variables and static variables?

Some may feel this question is subjective. But, I feel this is among the most important things to be told to a programmer. Is this a good function name to check for null values. 1. checkNull() 2. notNull() 3. isNull() What if I write checkIfNull() I do not know how many people share the same feeling as I do, I have spent more time...

Is there a public Maven repository that contains spring-core 3 yet?

Is there a public Maven repository that contains spring-core 3 yet? I can find 2.5.4 all day long but not 3. If there answer is yes, please include the location in the answer. ...

User initiated background process in a web application

I have a java web application wired using Spring on Tomcat. I need a way for a user to initiate a background process in the server and return a response to the user without waiting for the background process to complete. The background process is programmed in java and integrated with my application. Since i am using tomcat JMS is no...

is the buoybuilder project still alive?

A few years ago I used the excellent Swing development tool buoybuilder. Today I noticed that their former URL does not work. Is this project still alive? ...

log4j log files from an external jar are not created when using the jar in another log4j project.

Hello all, I am new to log4j but I've been reading for almost an hour, and I dont know how to solve this. I have a jar file A which uses log4j and writes logs to the console and to a file. I also have a java project, which uses external jar A. If the java project doesnt use log4j, then I can see the logs by A when running the java pro...

Confusing type conversion - 2 Bytes to Double

I was recently asked to take over a project in which waveform data is sampled from a power converter and sent to an intelligent agent where calculations are done and the appropriate actions are taken based on the results. The following (java)snippet is what the previous coder used to convert the byte array into an array of doubles: ...

Cannot create a for loop inside a java thread - why?

Hi, my code is as follows public void incomingMessageThread() throws FileNotFoundException, IOException { new Thread() { BuildData a = new BuildData(); for(int i = 0; i<100; i++) { a.parseDataFile("_"+i+"/outgoingMessages"); } }.start(); } I get told its an illegal start of ...

BeansBinding issue

Hi all I am using BeansBinding from java.net and i have a problem. When i sync String property from my model with the (Text) property of some (jTextField) the validator does not run when i do .bind for the first time only (my validator is to check if the jtextField is not null). While sync Float proerty from my model with the (Text) pro...

how to convert String object to Boolean Object

hi how to convert String object to Boolean Object ...

Pass a List to another jsp file

I wanted to pass a List type object which is in the main JPS to an include JSP ( jsp:include). Since the parm only support strings, I cannot use the parm tag to pass List type data to the include file. Uses examples: <jsp:include page="/jsp/appList.jsp"> <jsp:param name="applications" value="${applications}"/> </jsp:include> Or...