java

What Java file synchronization/backup library do you recommend?

Do you know any (open source) Java library that provides file synchronization/backup functionality? Many thanks. ...

Is there a way to use annotations in Java to replace accessors?

I'm a little new to the Java 5 annotations and I'm curious if either of these are possible: This annotation would generate a simple getter and setter for you. @attribute private String var = ""; The @NotNull annotation indicates that a variable connot be null so you don't have to write that boilerplate code every time. /* * @param ...

Unable to Locate Properties File Inside Jar During Junit Tests via Ant

Hello Fellow Programmers, I am having problems running my Junit tests via Ant. I can't seem to get Ant to see the properties file it needs to load a dll my project needs. All my tests work using the Junit GUI in Elcipse, so I'm pretty sure it's not a problem with the tests themselves. I think my problem is something classpath-related...

How do I make an Eclipse org.eclipse.swt.widgets.Text component wider?

I think the question says it all. I'm new to Eclipse plugin development, so I'm sure there's an easy answer. ...

coding connected nodes in graph

hi guys, I am trying to make a graph in java that would have different nodes. some nodes would be connected to others and some wont. If they are connected then some boolean value for that node will be true and another variable will hold the value of the node it is connected to. ...any suggestions on what you guys think is the best wa...

How can I download all emails with attachments from Gmail?

How do I connect to Gmail and determine which messages have attachments? I then want to download each attachment, printing out the Subject: and From: for each message as I process it. I never found a nice solution to this problem so I'm going to start a bounty. The person who provides the best answer wins. Please provide the complete...

Encoding for JMF

I'm creating some videos from a collection of images, I subsequently wish to play this video back with java. I found JMF but I haven't been able to find an encoding which is actually playable by it. Does anybody have an ffmpeg or mencoder formulation which produces JMF playable output? I would also take alternatives to JMF if there is...

reading COM port value and printing in textArea which located inside the panel in java

Hi, I'm beginner in java,i have to read COM port and the data should be displyaed inside the TextArea dynamicaly(data will come for every 1 min)which i have created inside JPanel.plz help me i'm not getting how to do... Advance Thanks for reply ...

deadlock on synchronized ( String intern())

I user sun jdk 1.5 ThreadPoolExecutor( 24, 24,60,TimeUnit.SECONDS, new LinkedBlockingQueue()). soemtime I use jdb tool to find the status of all threads in thread pool are " waiting in a monitor", the code is : String key = getKey(dt.getPrefix(), id); synchronized (key.intern()) { -----> Is there a problem in "synchronized (...

AS400 style naming over JDBC

Is there any way I can use AS400 style library/file style naming over JDBC with jt400? I want to be able to run queries like: SELECT * FROM MYLIBRARY/MYFILE Thanks ...

Why can't my Java webservice talk to my Perl backend?

In our project the Java webservice communicate with the backend program written in C and Perl to process. We are using the ProcessBuilderto execute a backend (UNIX) job FrameworkHandler. ProcessBuilder process; process.Start(FrameworkHandler -a ACTION) FrameworkHandler invokes a Perl script to perform some action. The Perl script int...

Error is loading the jars

i`m getting NoClassDefintion found error in my application even though i had the associated jars in my lin folder of my ear the error is java.rmi.RemoteException: EJB Exception: ; nested exception is: java.lang.NoClassDefFoundError: com/sun/rave/web/ui/model/Option Note i had added the same user library to my eclipse its not s...

How should I structure resource bundle property files which are used by jsps?

I am currently working on converting an existing web application to support an additional language (namely Welsh). My proposed approach is to extract all displayed text into property files and then access the text using JSTL fmt tags. My question is: how should these property files be structured? I know they need to be on the classpath ...

calling method Versus class.method

I have a class with two methods defined in it. public class Routines { public static method1() { /* set of statements */ } public static method2() { /* another set of statements.*/ } } Now I need to call method1() from method2() Which one the following approaches is better? Or is this qualify as a qu...

adjacency matrix in java or c++ to find connected nodes

Hi I am given a problem where I have been given N nodes in a graph that are interconnected to each other then given a matrix which lists down a node being connected to another (1 if it is, 0 if not). I am wondering how to best approach this problem. I think these are adjacency matrix? But how would I implement that ... Basically what...

Any reason to use JBoss 5 over Glassfish v2/v3 Prelude?

JBoss 5 has just come out of beta after 2 years, giving us a JEE 5 compliant container... several months before the release of JEE 6 (JavaOne in May or thereabouts 2009). We've had Glassfish v2 for awhile and now have Glassfish v3 Prelude. Is there any reason to JBoss 5 over these? I've had the feeling for the last year or more than J...

RDF / Jena: program logic changed by println??

I'm getting a strange effect in Jena 2.5.5 (on linux) where I am playing around with the inference API. The following code is a stripped down version. I am creating an initially empty Model and a generic rule reasoner. I add a reflexivity rule for a certain statement. I attach the reasoner to the model to get an InfModel. Then I create ...

How to determine a swing component?

Hi guys, I have a problem. I'm working on another guy's code and there is a JFrame with lots of JSeparators(he used them as borders for 'panels') now I'm replacing them for a JBorderedPanel class that follows the same border style of the whole application. The problem is that some of his separators are not clear to determine where the...

RMI, EJB and callback

Is it possible for a client to pass an RMI object as an argument to an EJB so that the EJB may callback the client? ...

How you organize non-source-resources available at the classpath in your java-project?

In a software-project written in java you often have resources, that are part of the project and should be included on the classpath. For instance some templates or images, that should be accessible through the classpath (getResource). These files should be included into a produced JAR-file. It's clear that these resources should be add...