Skip to main content.
November 30th, 2008

Java SWING Error Dialog with Exception Details

I use SWING for long time but I am amazed how slowly this GUI framework evolve and how far is it comparing to Windows Forms, WPF and Flex. One of the small missing things in Swing is that there is not standard way to display an error message with Exception stacktrace. So I created such dialog and I want to share it with everybody using SWING. The result look like this (shrinked form):

swing-error-dialog-shrinked.png

When the dialog is expanded, it shows the exception:

swing-error-dialog-expanded.png

It seems like creating such a dialog is trivial task but unfortunately you need to solve a number of problems related to correct positioning, scrolling issues, etc. When the exception is large, it needs a scroller. When the error description is logn it needs good layout and scroller. This makes the things a little bit challenging. See the code below (the ErrorDilaog class):

The ImageUtils class provides a simplified API for loading images from a file:

The class  ImagePanel shows image in a JPanel:

Download the entire example source code (Eclipse project): errordialog.zip.

I hope all this would be helpful to anyone. Enjoy!

Posted by nakov as java, blog at 11:31 PM EET

Comments Off

November 20th, 2008

Connect to Oracle Express Edition from Remote Machine

For development purposes and small applications I prefer using Oracle Database 10g Express Edition instead of the heavyweight Oracle Database 10g / 11g Enterprise. It can be installed and run for just 2-3 minutes but it has a small problem: by default the TNS Listener listens for connections on port 1521 from the local machine only and thus remote clients can not connect. A quick fix for this issue is to edit the LISTENER.ORA file located typically in here:

C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN

You should change the socket bind address to 0.0.0.0. The LISTENER configuration should look like this:

Posted by nakov as blog at 1:53 PM EET

Comments Off