Hello,
I wonder how one should implement an event which will do some Action when a button is pressed, and stop do that action when button is released
I tried to add MouseListerner for this approach. The problem is it will recognize that I have pressed the button. But not which button it is. So wonder how should it be written so it will ...
I'm using a SWT DateTime component. It sets the current date as a default selection, when instanciated. How can i prevent this?
I want that no date is selected at all...
Thanks
Patrick
...
I have a class that will be subclassed. All subclasses must contain a static method with the same signature, but differnt for each one.
I would like to have an abstract instance method in the superclass that subclasses will override, but it seems mot possible in Java, I wonder why.
A silly example:
Image{
abstract String getExtensio...
Does anybody know what is called first if a test fails?
...
Does anyone know of any tools out there which can summarize changes to Java interfaces between different versions? (By interface I mean the exposed functionality of types in general, not the specific language construct.)
What I would like is some program which takes two versions of the same package or package tree and outputs something...
http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization
Is this design pattern possible in Java? If so, how? If not, why not?
Thanks!
...
When I call the jrxml file through .load(), its throw a exception FileNotfoundException.
I have tried with absolute path, but it does not work. Please help.
...
I use the javadoc @version tag in my classes, however I am not sure how to get the version in the class itself. Let's look at an example...
/**
* @version 1.0a
* @author Redandwhite
*/
public class JClass extends JFrame implements ActionListener, KeyListener {
String version = ...
}
Is there a method/class that can retrieve the...
I made this in Photoshop and I plan to use it for my file sharing application:
I was wondering if it was possible to create GUI for my application that is gonna have this look and feel.
If I can't build it only by using eclipse or NetBeans, are there any other tools that could help me?
...
I'm using OpenJPA in my application as a JPA vendor.
The question is theoretical or conceptual:
Is there any way to tell an entity manager to load an entity from the DB rather than from it's cache?
The problematic scenario:
EM1.persist(Entity1)
EM2.merge(Entity1)
EM1.find(Entity1) <--- Entity1 is the cached version rather than the m...
How do I build up an atomic file write operation? The file is to be written by a Java service and read by python scripts.
For the record, reads are far greater than writes. But the write happens in batches and tend to be long. The file size amounts to mega bytes.
Right now my approach is:
Write file contents to a temp file in
same d...
Hi. I have a component in Tapestry 4 that should render only when user has privileges to use it's attached business code. In Tapestry 5 I would probably use rendering phases and would return false on SetupRender in order to skip rendering of this component:
http://tapestry.apache.org/tapestry5/guide/rendering.html
But how would I go a...
Hello again :)
I am facing another problem in my little test-webapp.
I have an EJB module (created via maven-pom) that basically wraps the data-access, so all it does is some DAOs implemented as Stateless-SessionBeans. My domain-model (simple POJOs with JPA2 annotations) is located in another, simple java, project that will be packaged ...
hi all,
I want to know the any Encryption-Decryption Algorithm (procedure) that can be implemented in C#.net as well as in Java. I have came accross a situation where, the data is encrypted by a C# code implemented using RSA using "RSACryptoServiceProvider" class and put it in Database. Now , I need to decrypt the same data in the Java ...
I have a problem when I try to instantiate Hibernate and connect with a MySQL database (see error message below).
Curiously enough the connection works fine using the exact same hibernate.cfg.xml file when running Junit tests but it refuses to work when run from Tomcat...
I am starting to run out of ideas.
Any clues or tip where to l...
How would I read a .txt file in Java and put every line in an array when every lines contains integers, strings, and doubles? And every line has different amounts of words/numbers.
I'm a complete noob in Java so sorry if this question is a bit stupid.
Thanks
...
In Java, how can I create a ClassLoader which will use a particular classpath (probably just a single jar file)?
...
I'd like to be able to set a property on the JVM using the -D switch. If I do that, can I access it from my code? If yes, how?
...
I'm looking for the best approach for string find and replace in Java.
This is a sentence: "My name is Milan, people know me as Milan Vasic".
I want to replace the string Milan with Milan Vasic, but on place where I have already Milan Vasic, that shouldn't be a case.
after search/replace result should be: "My name is Milan Vasic, peo...
Hi,
is it possible to get a File or URI object for a file inside an archive with Java?
(zip or jar archive)
Thanks Hemeroc.
...