java

How do I make Vista's Narrator read my Swing components back to me?

I'm trying to implement a very, very simple accessibility test for Swing so I can get a handle on how big a piece of work it will be to provide accessibility support for our already established Swing application. I have the most simple Swing program, and I'm using Narrator in Windows Vista to attempt to screen-read its GUI. public clas...

What free tools are available to analyze lock contention in java ?

I need to determine which locks are the most-contended-for in my application code. What free tools can I use to determine this ? ...

Speed tradeoff of Java's -Xms and -Xmx options

Given these two commands A: $ java -Xms10G -Xmx10G myjavacode input.txt B: $ java -Xms5G -Xmx5G myjavacode input.txt I have two questions: Since command A reserves more memory with its parameters, will A run faster than B? How do -Xmx and -Xms affect the running process and the output of my program? ...

Servlet service XSLTC transforming error

Following what seem to be the standard way to perform transformations using translets; see http://xml.apache.org/xalan-j/xsltc_usage.html#api; We perform the following steps Set the javax.xml.transform.TransformerFactory system property as indicated... Instantiate a TransformerFactory. Instantiate a Transformer object either directly...

Are there any built-in methods in Java to increase Font size?

Are there any built-in methods in Java to increase Font size? ...

How to get full path of the selected node in the package explorer from an Eclipse plugin?

I am attempting to get full path of a selected node in the package explorer which is a folder or package not a file in my Eclipse Ganymede plug-in. I tried the way that is mentioned at http://stackoverflow.com/questions/585802/how-to-get-the-selected-node-in-the-package-explorer-from-an-eclipse-plugin page, but whenever i use the follow...

Are static functions isolated in JSP/Grails applications under tomcat?

I'm using some legacy java code that consists of several static classes from with in a Grails app under tomcat. When I only have one user using the web application everything works fine. When two users use the application things start to go wrong. I believe it's because the static classes maintain resource locks such as sockets. Am I cor...

How to implement a custom cell renderer for ScrollTable in GWT

I've used the ScrollTable widget for GWT and I have a need for a custom cell renderer so I can isolate this code from the rest of the app. I would like to use generics if possible to get it type safe. This cell renderer will take a long as a value and do some calculation before displaying the result. Anyone having a good example on how ...

Is it possible to get a "potential" stack trace for a method at compile time?

So, I've got a routine that can be called from about four different functions. What I want to do is walk up the possible routes that a this routine could have been called from. I'm using Eclipse. I'm thinking this must be somewhat possible as I know I can do this by hand, albeit slowly. ...

Running a .sql script using MySQL with JDBC

I am starting to use MySQL with JDBC. Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection("jdbc:mysql:///x", "x", "x"); stmt = conn.createStatement(); stmt.execute( "CREATE TABLE amigos" + "("+ "id int AUTO_INCREMENT not null,"+ "nombre char(20) ...

How to set class path for client of web service in build.xml

HI, I need to know how to set class path for the client tag under web service of build.xml in java. I have to add the log4j.properties file to the client jar. Thanks Abhi ...

how to add a java class to a folder within a jar file

using jar on the windows command prompt, how can I add foo.class to a folder "classes" in foo.jar? I can add the file to the jar using jar uvf foo.jar foo.class but that doesn't put the class in the "classes" folder in the jar. I know I can use winzip to unzip the jar, add the file, and zip it up again, but that's slow and hopef...

Embeddable messaging component for Java web application

In order to satisfy customer requirements, we will need to let users exchange information among each other. The 'messaging system' does not have sophisticated back-end requirements and could be easily implemented with a few tables to store messages and message types. The problem is that I believe that the requirements on the front-end a...

Java - converting byte array of audio into integer array

I need to pass audio data into a 3rd party system as a "16bit integer array" (from the limited documentation I have). This is what I've tried so far (the system reads it in from the resulting bytes.dat file). AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File("c:\\all.wav")); int numBytes = inputStream.avai...

Is it possible to discover plugged disks from Java?

I'm writing a disk crawler and if the user doesn't provide an existing path the program should search all disks that are available. Does anybody know is it possible and if it is how to do that from Java? ...

'#' character before EL expression used inside a JSTL tag behaves strangely

I have the following code to set a userId variable: (userId set in prior code) <c:set var="userId" value="(Cust#${userId})" /> Which produces the following string: (Cust#${userId}) The following code works as expected, however: <c:set var="userId" value="(Cust# ${userId})" /> displays the following string (Cust# 0001) . Why does...

Why does Java not use the out parameter in its language syntax while c# does?

While I am not a huge fan of using the out parameter in c# I would like to know why Java chose not to include it in its language syntax. Is there any special reason or maybe its because a person can simply pass an object as a parameter type? ...

Efficient way to walk through an object tree?

I've got a set of TreeNodes, each of which has an id, a Collection of parent nodes, and a collection of child nodes. For a given node Id, I'm looking for an efficient way to generate all the links that pass through that node. So in short, start at the node, and iterate through all its children. If a node has more than one child, create ...

Java - How can I create a JTextfield that can be queried but not updated?

How can I create a JTextfield that can be queried but not updated? ...

Can Drools Flow scale to executing hundreds of thousands of process instances per day?

I'm currently evaluating Drools Flow as a workflow engine for executing up to hundreds of thousands of process instances per day. Has anyone published any scalability benchmarks for this technology? In the absence of published results does anyone have any relevant experience they can share? ...