java

Managing X10 devices from Java

What is the best open-source library to manage X10 devices from Java? ...

sharing message object between web applications

I need to share java mail message objects between two web applications(A and B). WebApplication A obtains the message and write it to the outputStream for(int i=0;i<messagesArr.length;i++){ uid = pop3FolderObj.getUID(messagesArr[i]); //storing messages with uid names inorder to maintain uniqueness File f = new File("F:/PersistedMe...

multiple sites with Java App Engine

I'm trying to create a series of sites that all run as one application, but have different designs (to localise them). My idea is to map separate domain names to the one site. E.g: www.mysite1.com maps to www.mysite.appspot.com/mysite1 and www.mysite2.com maps to www.mysite.appspot.com/mysite2 I'm guessing that there must be a url p...

Object doesn't do anything after instantiation - bad code smell?

Hi, I should probably know things like this by now - but for some reason this one passed me by! I have an object that I instantiate - it's quite nifty as it also extends a superclass and does some stuff in the contructor - in fact all the vital parameters and method calls are handled in the constructor. After this I never call the o...

What kind of OCR java library should i use in Android?

I would like to build an app that OCR a pictures and get text from them. What java library should i use? ...

How do I detect if a display is in High Contrast mode?

I'm testing my company's established Swing application for accessibility issues. With high contrast mode enabled on my PC certain parts of this application are rendered properly (white-on-black) and some incorrectly (black-on-white). The bits that are correct are the native components (JButton, JLabel and whatnot) and third party compo...

Mule Aggregator - Streaming Aggregation

The collection aggregator used in the Mule 2.0 framework works a bit like this: An inbound router takes a collection of messages and splits it up into a number of smaller messages - each smaller message get stamped with a correlation id corresponding to the parent message These messages flow through various services Finally these messa...

How to use common libraries for multiple Java web project

I am having four different project, and i am using Weblogic to deploy my projects. There are several libraries ( jar files ) which are common for all projects. Currently each of my project are having lib directory and have almost same set of libraries. Now, is it possible to have this lib directory outside WAR files and access them. ...

How to find classes when running an executable jar

I am running an executable jar and wish to find a list of classes WITHIN the jar so that I can decide at run-time which to run. It's possible that I don't know the name of the jar file so cannot unzip it ...

JDBC with MySQL really slow, don't know why

Hi guys, I have a problem with a really slow connection between my Java code and a MySQL Database. I don't know where the bottle neck is. My program is more or less a chatbot. The user types something in, my program splits the sentence into words and sends it word per word to the database. If it finds something there, the user gets an ...

how to read a xml file using java?

I need to read an XML file using java.Its contents are something like <ReadingFile> <csvFile> <fileName>C:/Input.csv</fileName> <delimiter>COMMA</delimiter> <tableFieldNamesList>COMPANYNAME|PRODUCTNAME|PRICE</tableFieldNamesList> <fieldProcessorDescriptorSize>20|20|20</fieldProcessorDescriptorSize> <fieldName>company_name|product_name|p...

Java equivalent to .Net's NotSupportedException

Is there (not NotImplementedException, not supported). ...

can javafx print to dot matrix printer ?

Hi, I have clients who still using dot matrix for making copies of printed documents (like invoice, reports, etc). I did a development using grails (web application) for internal company only (so it doesnt matter to install / update all java re in all computers) I am still learning (just started) Javafx. can i use this javafx to print ...

Map implementation with duplicate keys

I want to have Map with duplicate keys, I know there are many Map implementations(eclipse shows me about 50), so I bet there must be one that allows this. I know its easy to write your own Map that does this, but i would rather use some existing solution. Maybe something in commons-collections or google-collections? ...

Display sound (.wav/.mp3) as graph in Java

I need to display a graph of a sound file - i.e. a wave form as displayed by audio editors such as Audacity. How should I go about this? Is there anything in the Java Sound API that can help me? ...

how to decompress http response ?

Hi Can any one of you solve this problem ! Problem Description: i have received content-encoding: gzip header from http web-server. now i want to decode the content but when i use GZIP classes from jdk 1.6.12, it gives null. does it means that contents are not in gzip format ? or are there some another classes for decompress http resp...

JTabbedPane: Actions performed before displaying selected tab

When one of the panels present in a JTabbedPane is clicked, I need to perform a few actions at the start. Say, for example, I need to check the username and password. Only if those match, the particular panel operations need to be performed. Can you suggest any methods? ...

JSF: navigation

I have to warn you: the question may be rather silly, but I can't seem to wrap my head around it right now. I have two managed beans, let's say A and B: class A { private Date d8; // ...getters & setters public String search() { // search by d8 } } class B { private Date d9; //...getters & setters publi...

How does the JVM ensure that System.identityHashCode() will never change?

Typically the default implementation of Object.hashCode() is some function of the allocated address of the object in memory (though this is not mandated by the JLS). Given that the VM shunts objects about in memory, why does the value returned by System.identityHashCode() never change during the object's lifetime? If it is a "one-shot" ...

Usage of volatile specifier in C/C++/Java

While going through many resources on multithreaded programming, reference to volatile specifier usually comes up. It is clear that usage of this keyword is not a reliable way to achieve synchronization between multiple threads atleast in C/C++ and Java (versions 1.4 and earlier). Here is what wikipedia lists (without explaining how) as ...