Skip to main content
View by: Most Recent | Topic | Community | Webloggers   
Monthly Archives:    

Blogs by topic J2SE and user mkarg

• Accessibility • Ajax • Blogging • Business • Community 
• Databases • Deployment • Distributed • Eclipse • Education 
• EJB • Extreme Programming • Games • GlassFish • Grid 
• GUI • IDE • Instant Messaging • J2EE • J2ME 
• J2SE • Jakarta • JavaFX • JavaOne • Jini 
• JSP • JSR • JXTA • LDAP • Linux 
• Mobility • NetBeans • Open Source • OpenSolaris • OSGi 
• P2P • Patterns • Performance • Porting • Programming 
• Research • RMI • RSS Feeds • Search • Security 
• Servlets • Struts • Swing • Testing • Tools 
• Virtual Machine • Web Applications • Web Design • Web Development Tools • Web Services and XML 


Programming

One day I found myself in the situation that I had to write a unit test which checks whether my code is annotated in a particular way. I wondered how one could do that without doing an integration test that actually processes that annotations. My first idea was to use the Reflection API, which in fact worked, but was not looking smart. In fact, I wanted to have a Hamcrest matcher instead, since...
on Dec 27, 2013
As this JavaRanch article by Mark Spritzler proofs, there seem to be some people that like to have a generic visitor pattern, so I decided to open source mine (LGPL), which lies around here on my disk for some time. Have fun using it, it is as simple as linking to: <dependency>    <groupId>eu.headcrashing.treasure-chest</groupId> ...
on Oct 3, 2012
I hate adding lots of huge multi-JAR all-purpose common libraries to rather small projects! Huge footprint just for a single class is a side effect of many popular frameworks, unfortunately, due to rather coarse-grained modularity. So I started to publish some of my commons (LPGL'ed) code as single-class self-contained artifacts on The Maven Central Repository. You simple need a Range<T>...
on Sep 7, 2012
Meanwhile I am looking back to more than 25 years of programming, and more than a decade I spent in a very sensible area where quality (in the sense of zero failures) plays a big role. So call me "sensible" for quality. For long years "we" (i. e. developers) had hard work to do using simple command lines tools like vi etc., but meanwhile there are great, even free,...
on Dec 29, 2010
After more than a decade in the Java universe, today I had just enough of remembering where my executable JARs are located and typing all the lengthy path names, so I finally taught Windows to deal with Java archives just the same way as it deals with it's native executables EXE and CMD. The trick is so simple that I actually do not understand why the JRE installer isn't applying it automatically...
on Dec 29, 2010
Update (2012-09-24): Maven users, you can directly link this class (LGPL), as I have uploaded it into Maven Central. Simply add a dependency to: &lt;dependency&gt;    &lt;groupId&gt;eu.headcrashing.treasure-chest&lt;/groupId&gt;    &lt;artifactId&gt;EnumerationsClass&lt;/artifactId&gt;    &lt;version&gt;...
on Jul 4, 2010

GUI

Swing is not dead, still. While a whole lot of evangelists try to talk it dead, it is still part of the JRE. While SWT is not, still. And while JavaFX is not, still. Dispite all hypes and rumors. It is not even declared to be deprecated or obsolete. So in fact, there is no other real alternative to Swing as long as the GUI must work solely with JRE means (I won't say AWT is an alternative). And...
on Sep 7, 2012
Sometimes I wonder why rather good technology suddenly dies. Does anybody remember InfoBus? JavaBeans? Swing? Java? All of those had been brilliant technologies, enabling programmers doing things really easily. But at one day, news about those technologies just stopped. People tend to say that those technologies "died". Well, what does that mean, and is that true? Let's start with...
on Apr 24, 2011
It took me several sleepless nights to find out, but finally I got it - and was astonished how easy it is. Ever wanted to play the default system sound for a specific operation? Well, in fact there is no platform independent solution for that (can't believe it, I know, but it is true). But at least Swing internally does it that way on the Windows platform (and on other platforms it will just do...
on Jan 3, 2010
Blue sky, 25°C, the ideal weather to solve strange JNI problems. So I spent another valueable free day to solve on of the mysteries of mankind: Why is my ShellExtension crashing? (For those who do not know what a Shell Extension is: In short you could say it is a custom icon in the Windows File Explorer, and I want to have it implemented in Java using JNI). Everytime XP's Windows...
on Jan 3, 2010

Education

Often code has a bad smell, then it gets time to replace custom lines by common patterns. Sometimes it even makes sense to even replace a single line of code by a class just wrapping that single line (which actually increases code size), if that makes readers better understand what the code does. Unfortunately often such patterns are publicly known but do not exist as ready to...
on Jan 1, 2011
Just found out how easy it is to use the full screen mode in Swing and certainly immediately must write down this blog entry. Using the full screen mode is just as easy as the sample shows: public final class FullscreenSample { public static final void main(final String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); final JFrame...
on Jan 3, 2010
Java 6 comes with SwingWorker as an integral part of the JRE (yes, you no more need to download it). And THAT version of SwingWorker can send progress status while the background work still is in progress. Using this new feature, it is possible to do a lengthy background operation that reports its status from time to time. For example: While loading thousands of rows from the server (which might...
on Jan 3, 2010
Attaching a GUI to a domain model object (a.k.a. "Entity") is a boring job. You need to write lots of synchronization code or models to change the UI when the entity changes and vice versa. Now that has an end. Here is the ultimate, automatic glue generator: The Java Beans Binding API. It allows you to glue together two Java Beans (i. e. POJOs, and has nothing to do with Swing or EJB)....
on Jan 3, 2010
Do you know EnumSet? No? Then you should take the time to look at this sample code. EnumSet allows writing of really eloquent Java source code. Run the following code and watch its result printed on the screen. Then check the below source code to find out how it works. The source code particulary makes use of (at least) the following features introduced in Java 5: enum keyword The enum keyword...
on Jan 3, 2010

Mobility

When the iPhone came to market, Sun Microsystems announced that there soon will be Java for the iPhone. They got stopped by Apple's licence terms, which ban both, interpreted languages and code written in other language than C, C++, Objective C and JavaScript. Lately I read in the news that Apple change the licence terms, and found a promising statement on Apple's web site, so now...
on Sep 10, 2010

Databases

In my opinion, SQL Anyhwere is the best RDBMS I can think of. I can remember when we started distributing it in Germany back in the early 1990ies, as one of the first early adopters in this country. Since then, we provided it to hundreds of enterprises, from single-person laptop-only ones to large ones spanning replicated installations crossing country borders. So call me biased in that...
on Jul 3, 2010
If you wonder whether the style of use with JDBC API has an impact of performance, you might like to read my latest blog entry on Head Crashing Informatics. While the entry mostly is about tuning SQL Anywhere's BLOB handling performance, it contains an interesting aspect: There are three ways to deal with BLOBs in JDBC, and the performance difference is tremendous. While obvious for the JDBC...
on Apr 10, 2010

Community

For meanwhile more than 25 years I am writing computer programs. More than a decade I spent with programs accessing databases, virtually always relational ones. I soon learned that this is rather hard work. Not only that you need to know about the theory behind RDBMS iself, but also you need to know the technical APIs (like ODBC, ADO, RDO, JDBC, JDO, JPA, CMP, ...), the structure of...
on Feb 28, 2010
For many years I am using XSLT now for a lot of tasks in both, development and runtime environments: Source generation, creating HTML from XML data, or even rendering SVG vector graphics from XML finance data. But what really bothered me was that the XSLT transformer contained in Java (even in Java 6's latest release) was just able to do XSLT 1.0 but not XSLT 2.0. XSLT (and XPath) 2.0 comes with...
on Feb 6, 2010