java

How to instantiate a Java array given an array type at runtime?

In the Java collections framework, the Collection interface declares the following method: T[] toArray(T[] a) "Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a ne...

Good Authentication and Authorisation Package in Java?

I'm looking for an open source package written in java that implements a registration, authentication (like securityfilter) with captchas and email link verification and all that. I could write it, but why reinvent the wheel. I've looked all over the place and haven't found anything. Does such a thing exist? ...

Ant is not able to delete some files on windows

I have an ant build that makes directories, calls javac and all the regular stuff. The issue I am having is that when I try to do a clean (delete all the stuff that was generated) the delete task reports that is was unable to delete some files. When I try to delete them manually it works just fine. The files are apparently not open by an...

Getting java and flash to talk to each other

I have an application written in java, and I want to add a flash front end to it. The flash front end will run on the same computer as the java app in the stand alone flash player. I need two way communication between the two parts, and have no idea how to even start going about this. I suppose I could open a socket between the two prog...

Java Applet - Partially Signed?

Is it possible to sign only part of an applet? Ie, have an applet that pops up no security warnings about being signed, but if some particular function is used (that requires privileges) then use the signed jar? From what I can tell, some (perhaps most) browsers will pop up the warning for a signed applet even if you don't request priv...

Java operator overload

Coming from C++ to Java, the obvious unanswered question is why not operator overload. On the web some go about: "it's clearly obfuscated and complicate maintenance" but no one really elaborates that further (I completely disagree, actually). Other people pointed out that some objects do have an overload (like String operator +) but t...

Way to read Windows EventLog with Java

Does anyone have any pointers on how to read the Windows EventLog without using JNI? Or if you have to use JNI, are there any good open-source libraries for doing so? ...

What are the best resources for learning Java (books, websites, etc.)?

What are the best (as in most effective) resources for learning Java? ...

How should I start when developing a system based on modules or plugins?

Hello, I intend to develop a system that is entirely based on modules. The system base should have support for finding out about plugins, starting them up and being able to provide ways for those modules to communicate. Ideally, one should be able to put in new modules and yank out unused modules at will, and modules should be able to u...

Good book to learn to program well in Java (engineering or architecture-wise, not syntax)

I'm looking for a book to learn to "engineer" programs better. I program in Java already. Looking at the source code of open-source projects usually is too complicated as I have never made a program with more than 20 small files in it. I'm not an advanced programmer, I learned with a book and do this mostly for personal projects. My las...

What runs in a C heap vs a Java heap in HP-UX environment JVMs?

I've been running into a peculiar issue with certain Java applications in the HP-UX environment. The heap is set to -mx512, yet, looking at the memory regions for this java process using gpm, it shows it using upwards of 1.6GBs of RSS memory, with 1.1GB allocated to the DATA region. Grows quite rapidly over a 24-48hour period and the...

Similar thing to RJS (used in Ruby on Rails) in the Java web app world ?

In Ruby on Rails, there's RJS templates that help do AJAX by returning javascript code that will be executed in the client browser. How can I do a similar thing in the Java/J2EE world? Is Google Widget Toolkit similar to RJS? What options do I have? ...

is there an effective tool to convert c# to java?

is there an effective tool to convert c# to java? ...

Java Code Signing Certificates...same as SSL Certificate?

I'm looking around for a Java Code Signing certificate so my Java applets don't throw up such scary security warnings. However all the places I've found offering them charge (in my opinion) way too much, like over $200 per year. While doing research, a code signing certificate seems almost exactly the same as a SSL certificate. The mai...

Scanner cannot be resolved to a type

I just installed Ubuntu 8.04 and I'm taking a course in Java so I figured why not install a IDE while I am installing it. So I pick my IDE of choice, Eclipse, and I make a very simple program, Hello World, to make sure everything is running smoothly. When I go to use Scanner for user input I get a very odd error: My code:import java.uti...

React on global hotkey in a Java program on Windows/Linux/Mac?

A Java6 application sits in the system tray. It needs to be activated using a hotkey (e.g. Super-G or Ctrl-Shift-L etc) and do something (e.g. showing an input box). How do I do that on: Windows (XP or Vista) OS/X Linux (Gnome or KDE) ...

Java JFormattedTextField for typing dates

Hi! I've been having trouble to make a JFormattedTextField to use dates with the format dd/MM/yyyy. Specifically, as the user types, the cursor should "jump" the slashes, and get directly to the next number position. Also, the JFormattedTextField must verify if the date entered is valid, and reject it somehow if the date is invalid, or...

What is the best way to load a Hibernate object graph before using it in a UI?

The situation is this: You have a Hibernate context with an object graph that has some lazy loading defined. You want to use the Hibernate objects in your UI as is without having to copy the data somewhere. There are different UI contexts that require different amounts of data. The data is too big to just eager load the whole gra...

What is the best testing tool for Swing-based applications?

While we try to set up as many unit tests as time allows for our applications, I always find the amount of UI-level tests lacking. There are many options out there, but I'm not sure what would be a good place to start. What is your preferred unit testing tool for testing Swing applications? Why do you like it? Thanks! ...

Integrating static analysis tools with each other?

How are folks integrating various static analysis tools such as PMD, Checkstyle, and FindBugs so that they are used together in some uniform way? In particular, I'm interested in generating a single uniform report that includes warnings from all tools. Also, I want to be able to mark-up my code with reasonably consistent looking warning ...