java

KeyListener in Java is abstract; cannot be instantiated?

Hey all, I am trying to create a Key Listener in java however when I try KeyListener listener = new KeyListener(); Netbeans is telling me that KeyListener is abstract;cannot be instantiated. I know that I am missing some other piece of this key listener, but since this is my first time using a key listener i am unsure of what else i...

Best Collection To Use?

Hi There, I am reading log files but not all lines want to be processed straight away. I am using a queue / buffer to store the lines while they wait to be processed. This queue is regularly scanned for particular lines - when they are found, they are removed from the queue (they can be anywhere in it). When there isn't a particular li...

library for server side image resampling using java?

I want to create a serve resampled (downsized) version of images using jsp. The original images are stored in the database as blobs. I want to to create a jsp that serves a downsampled image with decent quality (not pixelated) as per the passed image width/height (e.g. getimage.jsp?imageid=xxxx&maxside=200) . Can you point me to a openso...

Accessing a "nameless" Jbutton in an anonymous class from another anonymous class?

Hey all, alright I know this sounds a little far-fetched, but let me explain. I created 26 JButtons in an anonymous actionListener labeled as each letter of the alphabet. for (int i = 65; i < 91; i++){ final char c = (char)i; final JButton button = new JButton("" + c); alphabetPanel.add(button); butt...

Remoting from a Swing app to GWT server

To put it simple, I've written a JSE Swing app that needs to talk to a GWT server I've written earlier. I absolutely love the way GWT does remoting between it's javascript and server sides and wish I could utilize this mechanism. Has anyone managed to use GWT-RPC this way? Should I just go Restlet instead? ...

How to create conditions based on user role using JSF/MyFaces?

What options do I have to read the roles of the current user from my JSP pages? I'm aware of the visibleOnUserRole="myRole" attribute on Tomahawk components, but I need roles for a bit more complicated things than simple visibility. ...

Java KeyListener for JFrame is being unresponsive?

Hey all, I am trying to implement a KeyListener into my JFrame. I have used the following code (at the moment im just trying to get this to work with my JFrame). System.out.println("test"); addKeyListener(new KeyListener() { public void keyPressed(KeyEvent e) { System.out.println( "tester"); } ...

Finding out which methods were changed by a checkin?

Here's the deal - I want a way to figure out specifically which methods were touched or changed within the last milestone/iteration so that the methods' Javadoc is checked for correct content, especially for the public API methods. Any ideas on how to do this, perhaps with an SVN hook? ...

Describe the architecture you use for Java web applications?

Let's share Java based web application architectures! There are lots of different architectures for web applications which are to be implemented using Java. The answers to this question may serve as a library of various web application designs with their pros and cons. While I realize that the answers will be subjective, let's try to be...

Jetlang PoolFiber sample

Dear all, I started with jetlang and the basic samples are pretty clear. What I didn't found is a good sample for using the PoolFiber. Anybody played around with that already? I read also the retlang samples but it seems little bit different there. Thanks for sharing your thoughts! Okami ...

Java PDF viewer with FDF

My company needs a PDF viewer with Java API with the additional requirement on being able to use FDF form data. The only one i found was JPedal which promises to feature everything we need, but it costs a bunch. So what are my options? Is there another tool to do it? edit: I found iText to be an easy way to merge FDF data into the PDF...

Getting Netbeans and Subversion to play together nicely with libraries?

I'm having a difficult time figuring out how to add a .jar/library to a Netbeans project in such a way that I can get it committed to the repository. The typical way to add a library (per the Netbeans documents I've already gone through) ends up with it just being local to me. Anyone who checks out my project ends up missing my require...

How to get color space of a jpeg/tiff in java?

Hi, the title sums it up really. Using the standalone exiftool program to dump all image metadata to a console I can see a line Color Space Data : RGB It looks like this is taken from the ICC-header I want to get the same data programatically in java. I've tried the drew noakes library and the Sanselan library, but neither give me a val...

Java control IP TTL?

In Java, is there a way to control the TTL of the IP header for packets sent on a socket? ...

Is there a tool to generate web pages based on Java beans?

Is there a tool that will take you java beans (pojos) and automatically make them a form for a webpage? To be more clear I have a bunch of Jaxb objects that I want to be able to display in a form without having to code a bunch of html. Is there a tool that will read the jaxb objects and generate the editable form for me? Also, this ne...

How to persist a property of type List<String>in JPA

What is the smartest way to get an entity with a field of type List get persisted? Command.java package persistlistofstring; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.persistence.Basic; import javax.persistence.Entity; import javax.persistence.EntityManager; import javax.persistence.G...

Introducing generics to Java code without breaking the build

The following code does not compile: public class GenericsTest { public static void main(String[] args) { MyList<?> list = new MyList<Object>(); Class<?> clazz = list.get(0); // Does not compile with reason // "Type mismatch: cannot convert from Object to Class" MyList list2 = new MyList...

Java - C-Like Fork?

Is it possible to do a "C like" fork in java, using an new independent jvm process ? How? ...

Java Reflection: How to know if a Method is static?

I want to discover at run-time ONLY the static Methods of a class, how can I do this? Or, how to differentiate between static and non-static methods. ...

Java <-> Javascript for non-Applets?

I'm working with an existing Java codebase which, while it can be invoked from an HTML page using an <APPLET> tag, does not actually subclass the Applet class. The same jars are also used in a non-browser context, so they did not subclass Applet. Now I need to communicate some values from Java back to the Javascript of the invoking page...