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

Blogs by topic: J2SE

• 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 


Education

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

GUI

Happy New Year folks! In 2002, I wrote a highly specialized, very small Q&D tool for my brother to support him in his oncological doctoral's practice. They are three physicians sharing a common room with some unique ultrasonic device. They needed something showing them at their desk wether the room is available or is currently occupied by somebody else. The name 'dokma' is a German pun....
on Jan 1, 2010
It's already five months since the version 1.0 have been announced at JavaOne. Today, new version of the SwingX have been released. This release is first Java 6 only compatible release. Setting base line to Java 6 allowed us to drop all the extra code necessary to maintain backwards compatibility for functionality added to the cora Javasince the release of Java 5. So as of today, you can benefit...
on Nov 2, 2009
As many of you may know, user interface design is a passion of mine. I want software that both looks pretty and acts well. I've had lots of ideas on the topic, often bleeding over into art and traditional design, in addition to usability. After thinking about it for a couple of years I've finally decided to create a blog dedicated to the topic: www.joshondesign.com At Josh On Design I'll be...
on Oct 20, 2009

Programming

Christmas holidays is one of my favourite moment in the year, I have time to see my relatives, read books, play with my kids and hack a little bit. Forewords I think I don't like the most in the strawman proposal is that the syntax for function type and for lambda literal reuse the same symbol '#'. It's something that I've observed when teaching C. The C syntax use * when you...
on Dec 27, 2009
Java VM embodies continuations now (not in production, in a hacking mode :), This post shows how to write a non-blocking server with continuations. Why using continuation with non blocking IO There are two models when you deals with IO: the thread model: read and write calls block until they at least read one caracter or write the whole buffer, so one use thread to be able to...
on Nov 22, 2009
Let me introduce a new language named pseudo (Why this name ? Why another language ? Why God ? all these questions will be answered in a later blog). One great feature of this language is that it allows gradual typing, i.e. you can assign a type to a parameter, a local variable, etc. or not. If a variable as no type, the compiler consider it as any. You can assign any value...
on Nov 1, 2009
In my last attempt to stress the JavaFX platform, I ported the Strange Attractor demo/benchmark. Different from JavaFX Balls, this is not scenegraph-driven animation, but old-school "pixel by pixel" drawing… still, makes for another batch of interesting findings, including a few issues in the JavaFX Script language and its compiler, and other topics like fractal maths, BigDecimal...
on Oct 29, 2009
While much have been written on checked vs unchecked exceptions, I found very little practical, down to earth, advice on how and why to use them. Here are my thoughts after years of rumination. The common wisdom What we are typically told is to use checked exceptions for recoverable conditions and unchecked exceptions for programming errors. For example here or in Effective Java. Don't get...
on Sep 25, 2009

EJB

NetBeans 6.8 released coordinated with GlassFish v3 today. NetBeans 6.8 can be considered a fine step ahead of NetBeans because Sun is officially supporting the NetBeans RCP platform as a product from now on. NetBeans 6.8 features are as follow: Java Enterprise Edition 6 support Web Projects with JavaServer Faces 2.0 (Facelets) JavaFX 1.2.1 support Kenai.com: Connected Developer Full support...
on Dec 17, 2009

J2SE

Caching of an empty array is a well-known pattern to improve performance. However, it is difficult to use it in generified classes. Out of curiosity, I created a custom implementation of the array creation method based on Array.newInstance. To cache empty arrays, I use synchronized WeakHashMap, which maps any given component type to a weak reference to the corresponding empty array. This is not...
on Dec 7, 2009
Few months back, I got an opportunity to review one of the uCertify’s PrepKit. So, I opted for SCJP 5.0 PrepKit and here’s what I had to write about the PrepKit. Update: 23rd Dec, 2009 uCertify writes special blog entries for their PrepKit reviewers. Have a look at blog about my review. See ya later..
on Dec 4, 2009
Today, a tantalizing announcement by Mark Reinhold about closures in Java 7 has made its way through the twittersphere. On the same day, Neal Gafter updated his closure proposal (known as the BGGA proposal, named after the initials of Bracha, Gafter, Gosling, and von der Ahé, and not at all related to the B. G. G. A. organization). Presumably the timing is not a coincidence. The proposal...
on Nov 18, 2009
Did you know javap ignores Class-Path manifest attribute where as javac honors it? I didn't. Now I know. I have a jar called foo.jar with following manifest entry: Manifest-Version: 1.0 Class-Path: javax.ejb.jar Created-By: 1.6.0_16 (Sun Microsystems Inc.) javax.ejb.jar contains all the EJB APIs and it is in the same directory as foo.jar. Yet, this is what I see when I run javap: javap -...
on Oct 14, 2009
When my colleague Marina Vatkina sent me some code earlier today hoping a second pair of eyes would spot the obvious error, knowing how thorough Marina typically is, I knew there was no obvious error there. Simplified version of what was being attempted is shown below: import java.io.*; import java.util.*; import java.util.jar.*; public class CreateJarWithManifest { public static void main(...
on Oct 13, 2009
While evaluating a GlassFish bug, I discovered a discrepancy in behavior of Class.getAnnotations() between IBM JRE and Sun JRE. the complex GlassFish issue boiled down to a simple test case as discussed below. The question is what should be the behavior of Class.getAnnotations() if one or more annotation class is not available at runtime. Consider the following test case: // Main.javaimport java....
on Oct 8, 2009
When you need to produce lots of fairly straightforward graphs, Java2D is your friend. In this blog, I show you how you can render simple images as crisp-looking PDF or EPS files, provided you can draw them on a Graphics2D object. Recently, I had to draw a bunch of simple images, such as this one or this PDF Of course, you can do these drawings in Illustrator or Inkscape. But if you are a coder...
on Oct 8, 2009
Today I've digged deeper into one of the nastiest problems I ever encounted since I became a Java programmer. The problem was this — I have the Hudson slave agent program, which blocks on stdin for read almost all the time. This process uses other threads to perform other activities (what this thread does is actually driven by what it reads from stdin, but that's irrelevant to this bug...
on Sep 28, 2009

Community

There was a bunch of good things to see at this years Devoxx. My personal highlights are ScalaTest (you definitively want to look into this when testing concurrency in any java code ... the best way to test different race scenarios I've seen so far). Another highlight was the amount of work done on JavaFX yet. The new UI for the clickable gui builder shown briefly by Tor ... surely you remember...
on Nov 24, 2009