Monthly Archives: March 2008

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