Category Archives: Java

Text preprocessing: Wrap around a punctuation with spaces using Java

Input text = “Hello-my $world?” Output text = “Hello – my $ world ? ” Advertisements

Posted in Java, text mining | Leave a comment

Cleaning Punctuations at the end and beginning of a word

Key: exploit the Character class.

Posted in Java | Leave a comment

JMenuBar/JMenuItem and JTextPane: Focus Owner Problem for Cut/Copy/Paste/Select All

When using JMenuItem in JMenuBar to cut/copy/paste/select all text from a JTextPane, a focus from JTextPanel is temporarily lost to JMenuItem. The loss of focus causes isFocusOwner() of JTextPane to return false. As a result, the cut/copy/paste/select all methods using … Continue reading

Posted in Java | Leave a comment

Implement Java methods for showing/hiding components

I am implementing a user-interface where there is a main JPanel called centerPanel containing two smaller JPanels, source panel and target panel. The source panel contains a JTextPane, and the target panel also contains a JTextPane and another JPanel for holding JButtons. The structure of this … Continue reading

Posted in Java | Leave a comment

Setup WEKA and LIBSVM for WEKA in Debian Etch

When we try to use LIBSVM through WEKA, we might encounter the problem of libsvm.jar not in the classpath. Here, I’d like to describe how to set up Weka and LIBSVM for weka. 1) Download from, and unzip … Continue reading

Posted in Java, Linux, text mining | 1 Comment

A Practice on LIBSVM Example in Debian Etch Using Java

This exercise comes from “A Practical Guide to Support Vector Classification” paper by Chih-WEi Hsu, Chih-Chung Chang and Chih-Jen Lin. It can be downloaded from The goal for writing this page is to record step-by-step instructions of an example … Continue reading

Posted in Java, text mining | 3 Comments

Some common errors in Jasper report: SEVERE: Digester.getParser and JRException: Error compiling report java source files

I’ve followed a tutorial on how to use Jasper report in Netbeans IDE at However, I encountered the following problems. (Please note that when I refer to jasperreport library, I mean my customized library that contains a number of … Continue reading

Posted in Java | 9 Comments