java

Is it possible to include JButton in a JTable?

I have a JTable that stores the results of a database query, so far so good. What I want is for the last column in each table to have a clickible JButton that will open the edit screen for the object represented in that row, and that means the button will need to know the details of the first column in the table from its own row (the ID ...

What tactics can I use to prevent users from discovering what language a website is written in?

So, if you are writing a website using Java and JSP's and didn't want users to know what language you written it in. What techniques would you use? ...

My code compiles in Eclipse but I get a ClassNotFound at runtime how can I fix it?

What would cause a jar to be added successfully to an Eclipse Java project but then at runtime some of the classes from that jar are not found with ClassNotFound exceptions? ...

What is the best Java-way to create JSON/XML REST Web services that is similar to WCF?

I'm looking for a best way that is available for Java developers to implement REST services that will be communicating via JSON or XML. I'm looking for production-ready products. I know that Spring 3.0 is coming, but it's not done yet - no luck. Is Jersey the one? My application is hosted by Tomcat, uses Spring, Jettison and XStream....

Making this code for image resize() work

My instructor sent me this code, which is supposed to be an integral part of an ongoing project. Thing is, it doesn't work. import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.awt.*; import java.awt.image.BufferedImage; import java.awt.image.Kernel; import java.awt.image.ConvolveOp; import com.s...

the get() function for java hashmaps

Hi, I've declared the following hashmap: HashMap<Integer, Hive> hives Where Hive is an object. If I call "hives.get(2)" will it return a copy of the object Hive at that location or a reference to it? My goal is to modify the Hive object at that location. If it returns the reference, I can just modify the returned hive and be don...

Multiple java Applets handling

I'm creating a simple java game Applet that has multiple Panels, The main game Panel has 4 JButtons that lead to the rest of the Panels when they are clicked. when the program runs, the four Panels are initialized 1st inside the init(), and inside each Panel initialization, I made all the Jcomponents invisible but only the main applet. ...

IllegalArgumentException: object is not an instance of declaring class

How is it possible that the "foo" exception is not thrown, but a subsequent call of invoke() throws the below exception? if (method.getDeclaringClass() != object.getClass()) throw new RuntimeException("foo"); method.invoke(object); Thrown exception: java.lang.IllegalArgumentException: object is not an instance of declaring clas...

Code generation in Maven

I want to autogenerate some java classes from interfaces. My first thought was to write a code generator, and integrate it as a maven plugin. I was thinking of creating a maven plugin with a codegen goal that is called during the build process. So if I choose this route, how do I provide the plugin with the interfaces to be processed? ...

Hibernate 2nd level cache

Hi I've run into some problems with hibernate 2nd level cache. As cache provider I use ehcache. Part of config from persistence.xml <property name="hibernate.cache.use_second_level_cache" value="true"/> <property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider" /> <property name="hibernate.cache.pr...

IDE plugin's for developing multithreaded network applications

I am looking for a plugin that helps developers create multithreaded network applications that works with either Eclipse and/or Netbeans. Should allow for functionality such as: Graphical modeling of callbacks Configuring executors Creating custom SSL factories Wizards for creating various filter streams ...

Webservice API for my Java App Engine GWT app

I'm creating a web app that runs on Google App Engine. I'm also developing a desktop client that needs to access/update data on the webapp. I would like to create a web sevice api between the server and the client. What would be my best options? According to GAE the do not support RMI og JAX out of the box. ...

Examples of Java I/O Stream Filters

I am looking for example code that demonstrates how to create a filter that understands binary data. Links to examples are greatly appreciated. ...

Any open source implementations of WS-DM working with JMX?

WS-DM is a web services equivalent of JMX. I am looking for an open source implementation... ...

Product browse in Java Servlets

Hi! I am creating a web application using EJBs and servlets. I have a page which displays a list of all items in the database. I would like to provide an option for the user to click on one of these items and this opens the SHOW servlet which gathers info regarding the item onto the page. I do not want to create a page for every single i...

SWT: Getting notified of a system device change (USB device connection / disconnection)

I'm writing an SWT application which needs to sit in the system tray and pop up automatically whenever the user connects some USB device (the application serves as its control panel). The way to do this in the native environment (win32 in this case, but I should be platform-independent ultimately) is to listen to the WM_DEVICECHANGE eve...

how to fetch data from a Microsoft Access database through JDBC and insert the table as a test field in an Applet

hi!! I have made a small letter game in a Java Applet. I have made a microsoft access database through jdbc for the high scores. I hav managed to insert values(scores) into the database but i hav truble in fetching them and display the table in a textArea of ajFrame. I am not even sure if the connection is established. I hav created the ...

How to use the "application" object in a Servlet?

If we are coding a JSP file, we just need to use the embedded "application" object. But how to use it in a Servlet? ...

Learning OpenGL through Java.

I'm interested in learning OpenGL and my favorite language at the time is Java. Can I reap its full (or most) benefits using things like JOGL or should I instead focus on getting stronger C++ skills? Btw, which is your Java OpenGL wrapper library of choice and why? ...

Vista glass border effect in Java Swing/AWT

I'm trying to create an overlay with a Vista Aero Glass -like background in place of a normal window. Part of my answer seems to be here, but I'm wondering how to get a blur effect in Swing/AWT. This looks like a start: public BufferedImage processImage(BufferedImage image) { float[] blurMatrix = { 1.0f / 9.0f, 1.0f / 9.0f, 1.0f / 9...