java

SWT Notification animated box (a.k.a toaster) needed

In a Java project (SWT desktop app), I want to inform the user about events through animated notification box (actually, it's not required to be animated). Something like MSN or any other IM client. There is JToaster for Swing, but I wonder if there isn't any other implementation based on SWT. Thanks! ...

Successful install of SJSAS 8.2EE Patch 2 on Solaris 10 x86?

"no asnss in java.library.path" This is what I get when trying create-domain on Sun Java System Application Server Enterprise Edition 8.2 (build b30-p02) Solaris 10 Generic_137138-09 i86pc i386 i86pc. I have also tried SJSAS 8.2EE Patch 6 and got the same error. Nothing seem out of place in the install log. Please advise... ...

Chained IF structure

Imagine this case where I have an object that I need to check a property. However, the object can currently have a null value. How can I check these two conditions in a single "if" condition? Currently, I have to do something like this: if (myObject != null) { if (myObject.Id != pId) { myObject.Id = pId; myObje...

How do you start derby in network server mode and still get an embedded connection?

I just want to know how I can start derby in network server mode and still be able to get an embedded connection? Thank you. ...

How to iterate over Hashtable in JSP

Hi.. I m doing a stuf in JAVA, as it is working fine.. now i need it to display in a browser using JSP, the following is my code.. Hashtable<String, Hashtable<String, Integer>> hash = categoryCountManager.getFunctionWithSubFunctionCount(1L); setCategoryDetails(categoryCountManager.getFunctionWithSubFunctionCount(1L)); ...

Spring, Hibernate & JPA: Calling persist on entitymanager does not seem to commit to database

I'm trying to setup Spring using Hibernate and JPA, but when trying to persist an object, nothing seems to be added to the database. Am using the following: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="url" value="${jdbc.url}"/> <property name="driverClassName" value="${jdbc.driverClass...

Can Intellij Idea open more than one physical editor window?

I can split editor panes horizontally or vertically, but it does not seem possible to view code in two separate physical windows. I am aware that Idea can open multiple projects in separate windows, but I'd like to be able to do this for two files in a single project. One answer suggested unpinning the tab, but I haven't been able to...

How can I make arbitrary font files available to Java?

I'm using a third-party library which accesses fonts through the GraphicsEnvironment: getAllFonts() call. This includes fonts in font registries belonging to both the JRE and the operating system. But on client machines that connect to our server I will likely not be able to install fonts into either of these locations. So how can I ma...

Error in Regex for String

I have simple regex "\".*\"" for me its says select everything between " and ", but it also catches "text") != -1 || file.indexOf(".exe" for me its two strings, for regex its one. how can i make regex to see that its two strings? P.S. I'm using Java. ...

Configure velocity to render an object with something other than toString?

Is there a way to configure Velocity to use something other than toString() to convert an object to a string in a template? For example, suppose I'm using a simple date class with a format() method, and I use the same format every time. If all of my velocity code looks like this: $someDate.format('M-D-yyyy') is there some configuratio...

Multi-threaded file transfer to a FTP server

I am writing a client for a backup server. My client schedules some folders for backup. (ex: every friday at hour X). I am using for scheduling cron4j (a port of Linux cron to java). Everything works nice until i schedule at the same time multiple upload jobs, then due to the multiple threads it gets messy. Can anyone help me with a so...

Why should I use Mylyn?

I would like to present a case to our stakeholders of why I would want to use Mylyn. Can you suggest any links to any convincing use-cases, documentation or tutorials that would convince a non-technical audience what Mylyn is, and why their team should be using it. I'm not looking for buzzword compliance or technical detail on how it wo...

How to resize a java applet when the browser is resized?

I have a java applet that is embedded in html using the object-comment-embed method. I would like to resize the applet whenever the browser window is resized. I have found solutions around the internet, but they all work based on the deprecated applet tag. Also, when trying a setSize() call on my embed element in FireBug, it will resize...

JTable selection change event handling: find the source table dynamically

I've implemented my own event handler and added it to the selection model of the table: table.getSelectionModel().addListSelectionListener(event); And implemented the method for "event" (mentioned above): public void valueChanged(ListSelectionEvent e) { log.debug("value changed"); } Unfortunately the event fires twice if I chan...

Error java.lang.NoClassDefFoundError on org.springframework.webflow.util.RandomGuid

Hi, I am sorry, my question is stupid, but I am not able to answer it, as a java illiterate. I run a tomcat (5) on CentOS5 (for a CAS server), and when I try to open this URL http://192.168.1.17:8080/cas-server-webapp-3.3.1/login I get this error : first error: java.lang.NoClassDefFoundError: Could not initialize class org.springfram...

Java equivalent to PHP's preg_replace_callback

I'm in the process of moving an application from PHP to Java and there is heavy use of regular expressions in the code. I've run across something in PHP that doesn't seem to have a java equivalent: preg_replace_callback() For every match in the regex, it calls a function that is passed the match text as a parameter. As an example us...

Java hprof question

What is the difference between using -agentlib:hprof=cpu=times vs -agentlib:hprof=cpu=sample when running a java class? I know that cpu=sample causes the jvm to sample the call stack at regular intervals, but what does cpu=times do? ...

Are there any cons to using jodatime?

I want to convince the architecture manager to include the joda time jar in our product. Do you know any disadvantages in using it? I think joda time needs to be constantly updated because of the files that it includes. And that is a disadvantage. Maybe I am wrong. Could you provide some clarity on the subject? Thanks ...

How do I use Helvetica in Java?

Helvetica is available in one form or another on Windows, Mac OS X, and Linux. Under Windows, I can see it from Microsoft Word. On the two UNIX platforms, I can find it with xlsfonts | grep -i helvetica; the name seems to be adobe-helvetica. But the JDK can't find it! It's not listed from GraphicsEnvironment.getAllFonts(), nor does i...

Serializing JENA OntModel Changes

I need to keep a couple of [Jena] Models (OntModels, specifically) synchronized across a socket, and I'd like to do this one change at a time (for various reasons -- one being that each Statement added or removed from the OntModels is also adapting a JESS rule base.). I am able to listen to the add/remove events on the OntModels and the...