java

How to make a Java serialized object being passed over network notify client GUI of change.

I am making a client-server Java app that is going to be MV(C, P) like. My current problem is once the client get's a Player object it needs to tell the GUI that the Player was changed and it should update everything on GUI. (Not too detailed, so entire update shouldn't be bad) /* * ClientGUI.java * * Created on Dec 10, 2009, 7:51:3...

Mutex in JNI using Foundation NSLock

I have some objective-c code that uses an NSLock to implement a sort of transaction. The object is locked on a "begin transaction", several other calls are made with the lock in place, and then it's released with a "commit". I'm writing a JNI glue layer to access this code from Java, but the lock is behaving differently in JNI vs pure ...

Animated Swing effect to display full-resolution image

I've got an editor with lots of image thumbnails. I'd like a double-click on an image to display the full resolution image using a modal undecorated dialog. Ideally, this would be animated, to show the image zooming up to full resolution on the center of the screen, then any click would make the image go away, either zooming back out o...

Can 12.1 be represented exactly as a floating point number?

This is in reference to the comments in this question: This code in Java produces 12.100000000000001 and this is using 64-bit doubles which can present 12.1 exactly. – Pyrolistical Is this true? I felt that since a floating point number is represented as a sum of powers of two, you cannot represent 12.1 exactly, no matter how many...

Java DirectColorModel vs. IndexColorModel when dealing with alphas

I have a BufferedImage that I get that has an IndexColorModel. I then wish to apply an AffineTransform with AffineTransformOP in order to create a transformed version of displayImage. Here's a code snippet: int type = isRGB() ? AffineTransformOp.TYPE_BILINEAR : AffineTransformOp.TYPE_NEAREST_NEIGHBOR; AffineTransformOp op = new Affine...

When is a ConcurrentSkipListSet useful?

I just saw this data-structure on the Java 6 API and I'm curious about when it would be an useful resource. I'm studying for the scjp exam and I don't see it covered on Kathy Sierra's book, even though I've seen mock exam questions that mention it. ...

advantage of using applicationcontext.getbean vs @configurable

Hi, what is the advantage of using @configurable compared to on bean that not managed by bean doing di by applicationcontext.getbean? any anyone list pro and cons? ...

Which is better? To use short or int?

In Java or C++: Which is better? To use short or int for numbers that go to the short Max value, from 0 to 65535 in the case of unsigned short in C++. I heard something about using int is better by the processor registers... ...

Understanding Spring annotation DI

@Repository @Service @Controller @Component -->only use for spring managed bean (no need weaving) -->@repository, @Service @controller is actually a @Component , just naming easier for programmer to understand @Configurable --->used for non spring managed bean (use with weaving) @Autowired --> use for DI for both cases abo...

Hibernate cascade delete not working when removing element of recreated bean

Supposing these are my parent and my child objects: Parent: @Entity @Table( name = "import_table" ) public class ImportTable { @Cascade( { CascadeType.ALL, CascadeType.DELETE_ORPHAN } ) @OneToMany( mappedBy = "table", fetch = FetchType.EAGER ) public List<ImportTableColumn> getColumns() { re...

Looking for a java based JBig2 decoder

Title says it all - does anyone know of a Java implementation of the JBig2 decoder? ...

A java sidebar with GridBagLayout

I am attempting to draw a sidebar for a project that I am working on. I chose to use GridBagLayout because I became frustrated with the limitations of BoxLayout. Could someone help explain what I am doing wrong. What I want is for the side bar to contain two JPanels. The code that I have places them halfway down the sidebar instead of at...

Listener Class not invoking method ?

I'm working on a Dynamic Web Project in Eclipse. The whole project was loading properly upon clicking the run in server button, a week back. But yesterday, when I pressed the run in server button, the console would give an error message stating that it can't load the Servlet Context. The server is Apache Tomcat 5.5 and the following is t...

how to use one jar that depends on another jar

suppose in my application "MyClass", I want to use class A in jar1, and some part of class A depends on some class B in jar2. If I put both jar1 and jar2 on my classpath and run MyClass, it still complains that class B can not be found. Could anybody tell me how to fix this problem? Thanks a lot. ...

Why I can not show my MySQL information in my GUI table?

I have a "Manager" class and "BirthList" frame. In my BirthList frame I have a GUI table that shows all the data that are in mySQL table but it does like this: When I open this frame, I see the last data that I added and when I click on Close button, at first the last data will be deleted from my table and then the frame will be closed ...

Best Eclipse Plugins for java development making use of spring/ struts /hibernate?

I am looking for plugins which make developer's life easy while using technologies like Struts/ Spring/ Hibernate. For instance, here is a requirement: If I were to change an Struts Action, I should be able to list out all the Struts Actions for my webapp, right click and add a method/ do some changes. So, basically, I need to know w...

What's a good strategy for automatically incorporating self-signed certs into my truststore in Java?

We've built a JEE app in JBoss that exposes web services to external consumers. We want to secure these services so that we know who is making the web service invocations. We have a registration process that requires the consumers to upload their public key so that we can add it to our truststore. However it is currently a manual proc...

How to get the details using telnet API

Is it possible to get the following information via Telnet? Software version config files config register information on traffic and errors If you have sample code that you could share that would be really useful so that I can procceed further with your help . I will be thankful for your valuable replies. ...

how to generate RSS for news sites programmatically in java/j2ee?

how to generate RSS for news sites programmatically? I dont know how to start.. ...

How to debug compiled Java code in Eclipse

Hi, I wonder if there are any solutions for Eclipse IDE to debug Java code for which I have no source, i.e. to debug dynamically decompiled code, step through it, etc.? I tried to use JD-Eclipse, JadClipse, and these plug-ins work great if I want to look at some class files, but as I debug, I get "Source not found." - how can I "attach" ...