I’ve added some notes on video screen capture for software demos over on Random Tech Notes. This isn’t strictly Java-related, though I’ve been experimenting with screen recording in the context of capturing a Java application that has animation and audio synchronized to user interaction, two factors that complicate the task a bit.
Author Archives: Philip Isenhour
Headless Exception Work-Around
On upgrading a piece of (1.4-dependent) server-side software from 1.4.2_01 to 1.4.2_14, I began seeing errors that looked like: java.awt.HeadlessException at sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice (HeadlessGraphicsEnvironment.java:66) at javax.swing.RepaintManager.getVolatileOffscreenBuffer (RepaintManager.java:537) at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4727) at javax.swing.JComponent.paint(JComponent.java:798) at edu.vt.cs.collab.cork.impl.servlet.CORKServlet.encodeComponentAsJPEG (CORKServlet.java:617) at org.isenhour.fin.inc.CEFChartWebView.writeChartImage(CEFChartWebView.java:97) at org.isenhour.fin.inc.CEFChartWebView.writeStaticContent(CEFChartWebView.java:84) at edu.vt.cs.collab.bridge.DefaultWebViewServlet.doGet(DefaultWebViewServlet.java:95) at edu.vt.cs.collab.cork.impl.servlet.CORKServlet.doGet(CORKServlet.java:293) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) …. The offending code segment was: img = new BufferedImage(sz.width, sz.height, BufferedImage.TYPE_INT_RGB); …
Opening Java WebStart from the Command Line
For scripting or debugging it is sometimes useful to be able to launch WebStart from the command line, rather than from a web browser. “Launching Java WebStart from the Command Line” describes several options for doing this, along with examples for OSX, Linux, and Windows.
Generating a Stack Trace with jdb
Every once in a while I run into a situation where the usual means for generating a thread dump does not work, making it difficult to track down pesky deadlocks. Rather than actually figuring out why that happens, here are some notes on using jdb to generate a stack trace: JDB Example: Generating a Thread …
Checking out Apache’s FeedParser
In searching for a Java library to parse RSS and Atom feeds I ran across FeedParser from the Apache Jakarta Project. From a few quick experiments this looks pretty slick, but is unfortunately marked as “dormant” and shows no evidence of having been updated in a few months. Presumable as a side-effect of domancy, no …
A Simple GridBagLayout Example: Forms
GridBagLayout is, at times, a little too flexible. This simple example illustrates the use of GridBagLayout to generate nicely aligned forms for entering data.
Profiling WebStart Apps with JProfiler on OSX
JProfiler is a great tool for tracking down pesky memory leaks and performance problems. Here’s a trick for configuring JProfiler for use with remote Java Web Start applications on OSX.
Compressing Socket Data
The java.util.zip package includes classes for compressing and decompressing data using the ZLIB algorithms. The stream classes in the package are well-suited for accessing files and other bounded data, but do not work as well for compressing unbounded, continuous data transmitted over a socket. “Compressing data sent over a socket” describes the underlying issues and …
Lucene In-Memory Search Example
Apache’s Lucene text search library provides powerful and flexible tools for searching collections of text. While the indexes that Lucene builds are often stored on disk, the libary includes the ability to create an index in memory. This is particularly useful in restricted environments such as unsigned applets and WebStart applications. “Lucene In-Memory Text Search” …
Testing Strings for Equality
Strings are Objects in Java, but the ability to use literals, along with the String concatenation operator, make them somewhat similar to primitive types. Java also automatically “interns” String literals, meaning that a single String object will be created for a literal that is used multiple times. “String Equality and Interning” describes the effect of …