java

Pacman in Java questions

For my university assignment I have to make a networkable version of pacman. I thought I would best approach this problem with making a local copy of pacman first and then extend this functionality for network play. I would have to say that I am relatively new to java GUI development and utilizing such features within java. http://ww...

To check in, or not check in, the entire Eclipse project?

I'm soon going to check in the very first commit of a new Java project. I work with Eclipse Ganymede and a bunch of plug ins are making things a little bit easier. Previously I've been part of projects where the entire Eclipse project was checked in. It's quite convenient to get the project settings after a check out. However this appro...

Using Oracle ref cursor in Java without Oracle dependency

According to google and some other sources (e.g., http://www.enterprisedt.com/publications/oracle/result_set.html), if I want to call a stored-function that returns a ref cursor, I need to write something like this in order to access the ResultSet: String query = "begin ? := sp_get_stocks(?); end;"; CallableStatement stmt = conn.prepare...

Is there a library that generates UIs based on metadata declarations like this>>?

Hello, Do you know about a library that allows us to generate UI by just stating that it should be generated? I think there must be a person who have implemented a mechanism allowing us to transform code like this: class Main { @Command int add(int a, int b) { return a+b; } } into, say, a dialog with 2 text fields...

Piracy protection using USB based hardware solution

Hi, i want to protect my Java product by using some USB-based authentication and password management solution like you can buy it here: aladdin This mean that you have to connect a USB stick with a special software on it, before you can start your application. I would like to here some experience of users which have used hardware like ...

Why is Long.valueOf(0).equals(Integer.valueOf(0)) false?

This questions is prompted by http://stackoverflow.com/questions/444638/strange-hashmap-put-behaviour#444757 I think I understand why Map<K,V>.put takes a K but Map<K,V>.get takes an Object, it seems not doing so will break too much existing code. Now we get into a very error-prone scenario: java.util.HashMap<Long, String> m = new ja...

Tracing IO in java application ?

I am trying to find out why Apache CXF is running away doing "something" upon first-time initialization of a web-service. "Something" is probably some kind of IO, and I'm guessing it's trying to resolve an external address/schema/DTD of some sort. So I'm trying to find some kind of hook where I can monitor all IO. Either at VM level or ...

Can I use two different look and feels in the same Swing application?

I'm using the Flamingo ribbon and the Substance Office 2007 look and feel. Of course now every control has this look and feel, even those on dialog boxes. What I want is something like in Office 2007, where the ribbons have their Office 2007 look, but other controls keep their native Vista/XP look. Is it possible to assign certain con...

Standalone Java Applications

is there a way to compile java files into executable with high quality free software and without going through using executable JAR files? ...

Which XPathAPI should I use in Java 1.5?

I have been using com.sun.org.apache.xpath.internal.XPathAPI for some time and it seems to work ok. Recently I tried to use the TPTP profiler in Eclipse but it could not find the XPathAPI class. I haven't figured this problem yet but it did make me wonder whether I should be using a class in an 'internal' package? Should I be using the ...

Problems with Struts and AJAX

Hello, Here is my problem, I'm bulding a modular aplication, and I'm using the SwitchAction in the struts-config.xml to change to another config file, eht problem is that when I change to the other module, and get back to the default config xml, I'm getting a error, because my page use a AJAX request to get some data from the DB, and I'v...

tomcat error - "This release of Apache Tomcat was packaged to run on J2SE 5.0"

Hi, We are getting this error on starting tomcat (both as a service and via command line): This release of Apache Tomcat was packaged to run on J2SE 5.0 or later. It can be run on earlier JVMs by downloading and installing a compatibility package from the Apache Tomcat binary download page. We have the version with a tomcat5.exe and ...

Terracotta as data layer

Is it possible to use terracotta for storing data instead of a traditional DBMS? ...

Best way to define error codes/strings in Java?

I am writing a web service in Java, and I am trying to figure out the best way to define error codes and their associated error strings. I need to have a numerical error code and an error string grouped together. Both the error code and error string will be sent to the client accessing the web service. For example, when a SQLException oc...

How do you develop JSF apps?

I'm working for the first time on a project that requires building a webapp which makes heavy use of JSF (and ICEfaces in particular). There's a mix of stuff to be coded including CSS, HTML, JSP/Java and, of course, JSF. I'm doing all this within Eclipse btw and using a local tomcat server which eclipse is responsible for launching in o...

java and javascript callbacks compared

Hello, It seems I don't understand javascript callbacks quite as well as I thought. In the following example, I would think that each copy of function in setTimeout would refer to its own copy of the variable "index". Therefore, running the example should produce the following alerts: "zero" "one" "two". var array = ["zero", "one", "t...

Changing the font of text being typed in a JTextArea

I am working on a chat application and I want the user to be able to change their font while typing messages. I tried using the setFont() method but it changes the font for the entire text within the JTextArea component and when the text is sent to the display area, another JTextArea component, the font changes do not appear. Instead i...

What can I use to connect Java to Video4Linux?

I need to talk to Video4Linux (to capture output from a webcam) on a debian system running on an armel system (OpenMoko). JavaMediaFramework won't work in this case as it only have x86 and AMD versions. The linux kernel is 2.6.24 (with the v4l drivers compiled in separatly) and I cannot upgrade it (as it is not available on my hardware...

How do I map a CHAR(1) to a boolean using Hibernate for Java?

How do I map a CHAR(1) to a boolean using Hibernate for Java? ...

How do I use JProgressBar to display file copy progress?

I am working on a project that transfers files over a network and I want to incorporate a JProgressBar to show the progress during file transfer but I need help on that. ...