I am animating a series of images in java. So far I able to animate without any problem. The problem occur only when I add in control(Start, Stop, etc..). When I press Start in my GUI the GUI does not show the animation only the last frame is shown after the animation has ended.
I not sure is it the threading problem or a painting probl...
The original SCrypt implementation is in C. Are there any known Java ports?
...
Anyone come across anything else that is similar or close in quality/features?
Cheers.
...
I need to write an arrow listener for my JTextField. if a try with:
public void keyTyped(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DOWN) {
......
}
}
...
This is not good.( I think that JTextField is not responding to a special key listener.)
...
Hi All,
i am making http connection using
URL urlToConnect = new URL ("http://www.xyz.com");
HttpURLConnection connection = ( HttpURLConnection ) urlToConnect.openConnection();
I need to set the following property ,i am doing it like
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setRequestProperty("...
So, here is the code which create the table in an Oracle 10g / UTF-8 database :
CREATE TABLE TEST_SEMANTIC
(
SEMANTIC_COLBYTE char(2 byte) ,
SEMANTIC_COLCHAR char(2 char)
);
meaning, that I use two differents types of semantic for the two columns, byte and char.
I then insert inside the database these corresponding data :
insert in...
I want to check if a given Class is assignable to a java.util.Collection, and if so create a new instance of it.
I tried the following:
Class<?> clazz = ... // I got this from somewhere
if (!clazz.isInterface() && java.util.Collection.class.isAssignableFrom(clazz)) {
java.util.Collection<?> collection = clazz.newInstance();
}
...
Could someone please recommend a suitable FOSS Java technology for developing a webservice with these requirements:
Needs to query an Oracle database, return XML data, and support rollbacks (so probably would have to maintain state in some way).
Currently I have a webservice written in PHP, but I've found PHP's support for SOAP limitin...
I need to process a huge XML file, 4G. I used dom4j SAX, but wrote my own DefaultElementHandler. Code framework as below:
SAXParserFactory sf = SAXParserFactory.newInstance();
SAXParser sax = sf.newSAXParser();
sax.parse("english.xml", new DefaultElementHandler("page"){
public void processElement(Element element) {
// process ...
I am aware of the getResourceAsStream() method but there is an issue with the parser that reads the file, the whole structure was implemented to expect a FileInputStream() and the getResourceAsStream() returns an input stream which cannot be casted. Is there any easy "fix" for this situation?
...
is there any function in java that converts string to byte array ?
...
I have a class A with a
public String toString() {
}
method.
It gets compiled.
Also, I have several implementations of that method as a method body.
This implementation uses A's fields.
I want to be able to dynamically substitute the contents of the toString() method
with such or such an implementation. The point here is that I ne...
What are you views on using CheckedExceptions and RuntimeExceptions in an application ? I've been advised to use a combination of both and, as far as I understand, you can have a chain of CheckedException calls being propagated up along with a RuntimeException.
...
First of all, let me say that I dont use the DefaultTreeModel. I implement my own TreeModel, so i cant use the DefaultXXX stuff. The problem is this: Through some addStuff() methods which my model defines I add nodes to the underlying data structure. I then notify listeners by calling treeNodesChanged() inside the addStuff() function (I ...
I am trying to consume the Exchange 2010 Web Service interface using JAX-WS. I'm using JAX-WS 2.2 RI (Metro 2.0). 2.1 exhibited the same problem.
I am running into trouble with Exchange, which returns "HTTP/1.1 415 Cannot process the message because the content type 'text/xml;charset=utf-8' was not the expected type 'text/xml; charset=u...
Why does Java allow a top level class to be declared as private? Is there any other reason other than "We can't access a private class"?
...
I want to replace a single <, but not <<, using a Java regexp (so I'm working with String.replaceAll()). Right now I have
([^<]|^)<([^<]|$)
which works in Python, but not Java. I have also tried negative look-around, with something like
(?<!<)<(?!<)
However, all my current attempts match << as well. Am I doing something wrong? Is t...
I'm new to both memcached & sharding.
I gone though some articles on both. I need to implement both in my application.
Articles I'd gone through were good but none of them gave me how to use these technologies.
Anyone who can suggest me the links from which I can actually configure them and run the samples.
I want to implement memca...
I am writing Java code that has to distinguish regular expressions with more than one possible match from regular expressions that have only one possible match.
For example:
"abc." can have several matches ("abc1", abcf", ...),
while "abcd" can only match "abcd".
Right now my best idea was to look for all unescaped regexp special cha...
My question is about how I add an object to an array, in my case I have an array class with 4 columns and I cant get my program to add an object to the array.
I have tried with:
DatabaseTable dt = new DatabaseTable();
dt.add("something", "something", "something", "something");
but my program wont run.. Anyone how knows how to do it?...