java

Where to put a local xsd file in Jboss 4.05

Hi, I am working on Jboss 4.05 , I have an xsd file that was on jboss.com and want to have it locally on my system, I can not find the right location to put this file, when starting the jboss I get this error: Offending resource: class path resource [spring/my-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBe...

What is java's equivalent of ManualResetEvent?

What is java's equivalent of ManualResetEvent? ...

java font format exception on osx with java 4 update

I'm getting a java.awt.FontFormatException: Unrecognised Font Format error, and I believe this has been happening only since performing the 10.5 java 4 update, though I can't verify that to be exact. My java version after the update is 1.5.0_19 I'm using jruby in rails to generate a font with the following code: font = java.a...

Can I construct a jodatime.Duration object with milliseconds resolution?

The API doesn't seem promising. ...

Compiling Java code on the command line in Mac OS X

Really basic question I'm sure for some of you Java heads out there. I have a list of java files and jars that are required. On windows to build I have this batch file javac -cp .;opencsv-1.8.jar;mysql-connector.jar -source 1.4 -target 1.4 *.java jar cvf cup.jar *.class del *.class If I want to do the same thing on mac how would a ...

How to register listening for any Contact changes on android

Hi, How to register listening for any Contact (add/remove contact, change in email/phone) changes on android? Thank you. ...

Specifying start/stop time in millisecs when playing MP3 using JLayer

I need to play a part of an MP3 file in my java code. I wish to do this via a function which accepts the start and stop time in millisecs. JLayer contains a class called AdvancedPlayer which has a method that accepts the start and stop position in frames: /** * Plays a range of MPEG audio frames * @param start The first frame to play...

Test Cases: Mocking Database using Spring beans

Our application has a service layer and a DAO layer, written as Spring beans. While testing the Service Layer- I do not want to depend upon a real database so I am mocking that by creating a 'Mock' Impl for the DAO layer So when I am testing the Service layer- I chain the Service layer beans to the Mock DAO beans And in Production- wil...

How to change the Dimensions of the Applet Viewer in NetBeans 6.7

Hello I was waiting for the stable release of Netbeans 6.7 before starting to use it for my Java Programming. I would like to how to change the Dimensions of the Applet Viewer in NetBeans 6.7. When ever i run a java file by pressing SHIFT + F6, it opens an Applet but the dimensions are too small, i think they are around 300 X 300. H...

J2ME TextField Exception

When I instantiate a textField, I have a number in it that I want to be the default text. The problem is, I can't seem to be able to place that value into the textfield without getting an error. The strange thing about it is that the same TextField is what I use to set the value of the variable containing the number. TextField myTF = ...

How can I create a ddl for my jpa entities from java code?

Hi, I look for a way how I can create a ddl for my jpa annotated entities. I prefer a pure java way for this. If possible it would be nice to have generate the drop statements too. ...

Setting background images in JFrame

Are any methods available to set an image as background in a JFrame? ...

Is there any difference between the **copy** and ** addAll**??

1)Is there any difference between these two keywords for the elements of collections??(Copy those elements to the other collection and addAll those elements to the other collection) ...

Knowing when a JFrame is fully drawn

I have a program that creates a JFrame and makes it visible. Is there anyway to know when the JFrame is fully drawn and visible? Right now a hacky "wait and pray" method is being used. Thanks for the help! ...

superinterface in java

What is super-interface is java? what is the purpose of super-interface? ...

xsl cdata-section-elements output property with Xalan-J

I'm trying to output a CDATA section in the result of XSLT using Xalan 2.7.1. I have applied this XSL to the XML in a tool and the result contains CDATA. In the method below, no CDATA is in the result and no exception is thrown. I feel like I'm missing something here. test.xml <?xml version="1.0" encoding="UTF-8"?> <parentelem> ...

Is there any difference between these two groups of statements.

Set<Type> union = new HashSet<Type>(s1); union.addAll(s2); AND Set <Type> union = new HashSet<Type>(); union.addAll(s1); union.addAll(s2); ...

what's the main difference between j2se and j2ee?

I'm new to Java, so any comment is welcome. ...

How to mark some code that must be removed before production?

Sometimes for testing/developing purposes we make some changes in the code that must be removed in a production build. I wonder if there is an easy way of marking such blocks so that production build would fail as long as they are present or at least it will warn you during the build somehow. Simple "//TODO:" doesn't really work because...

Implicit and explicit exception difference

Hi, What's the difference between implicit exception and explicit exception? If I declare catch block like: catch(Exception e). Is this implicitly declaring an exception, or explicitly? Thanks in advance. ...