Skip to main content

Java 6 and one area where Eclipse is better than NetBeans

After reading the latest status report on Java 6 (Mustang) I downloaded and installed the latest Java 6 drop (build 45). I then ran some quick and dirty tests to check out some of the improvements mentioned in the status report. Note that I'm running both versions of Java under Windows XP SP2 on a Gateway M680 with a 17" LCD screen.
Feature: Improve Windows Look and Feel
Bug IDs: 5106661
Status: 5106661 integrated into b14, remaining work ongoing
The look and feel is indeed looking better. The following screenshot shows SwingSet under 5 on the left and SwingSet under 6 on the right. The look under Swing 6 uses the same windows widgets you see in Window's File Explorer.


Feature: Improved text quality and capabilities
Bug IDs: 4502804, 5057760, 4871297, 4726365
Delivered: b39
This feature has indeed been delivered. The following is a comparison between two samples of source code in the SwingSet demo app. The difference between the selection of the fonts as well as their rendering is the difference between night and day. It's unbelievable the improvement in overall quality. Again, SwingSet under Java 5 is on the left and under Java 6 is on the right.



Time and schedule permitting I'll look at other features mentioned in the Java 6 update.

Comparison: Eclipse text rendering vs. NetBeans text rendering

When I was ranting yesterday about NetBeans and Eclipse, I overlooked the most fundamental and important difference between the two IDEs: text rendering, especially in an editor pane. Rather than talk about it, look at the following screen captures where the same source file in both IDEs are shown side-by-side. NetBeans 4.1 is on the left and Eclipse 3.1 is on the right.



As far as I'm concerned the difference is crystal clear. Regardless of the warts and limitations I'd rather work with Eclipse, especially on Windows XP running on a notebook like the Gateway with ClearType technology. I tried to run NetBeans with Java 6 by changing NetBeans netbeans.conf netbeans_jdkhome property to point to my installation of Java 6, just to see if NetBeans 4.1 would benefit from Java 6's new text improvements. It does not, at least with the text editor. But it does take advantage of Java 6's text improvements in some odd places. Take a look at the following image, for example.



Look at the right side of the Properties pane and see the difference between text on the right vs. text on the left. The text on the right is much clearer. Text in the editor did not show any benefits, and looked just as bad as it does in the earlier side-by-side comparison with Eclipse.

One "Clear" Area of Superiority

I've always felt uncomfortable about SWT because I cut my user interface teeth on Java using JFC. But in this particular instance SWT is head and shoulders above Java because SWT is a wrapper around the underlying operating system's (Windows in this case) text rendering engine. Applications written to use SWT benefit from many of the Windows UI features that native Windows applications do. I have poor eyesight, and I do suffer from eye strain and headaches from long sessions in front monitors reading and working with lots of text. Working with the latest versions of Windows in front of LCD screens is a lot easier for me than stock CRTs or other operating systems that don't have the equivalent text rendering technology. The only exception to this that I've seen to date is Mac OS X.

The Future of NetBeans and Java 6

Reading the Mustang status report, this caught my eye:
Feature: New Examples
Bug IDs: 6246816, 6246820, 4989244
Status: In development
Description: Swing's current examples do not illustrate best practices and are not representative of real applications. With that in mind, we plan on providing two distinct types of examples. One shows all the widgets in all possible states. SwingSet2 currently serves this purpose but has grown stale and out-of-date. The second example type is one that better matches a real-world application, showing best practices in using the toolkit.
Let me make a suggestion to both the NetBeans 4.2 development team and the Java 6 development team. Work together so that NetBeans becomes the second example mentioned above, showing best practices in using the JFC toolkit. Both Java and NetBeans would benefit from the combined effort. And NetBeans will certainly benefit from better use of Java 6's text rendering improvements. When NetBeans text editors look every bit as good as Eclipse's, especially on LCD screens (which are the future) then NetBeans will truly stand shoulder-to-shoulder with Eclipse where it matters most.

Comments

  1. A good idea, though I think they may be ahead of you on this. I heard netbeans was being used as a test bed for several of the bits and pieces in mustang.

    As to the side-by-side comparison of text rendering: perhaps I'm a bit young and my eyes too good, perhaps the display on the laptop I'm working on doesn't emphasize the difference properly, but I just don't see it.

    ReplyDelete
  2. >> but I just don't see it.

    The problem is that blogspot converted my very clear PNGs into very blurry jpegs. I'll need to try this again over the weekend with a different set of images *sigh*

    ReplyDelete
  3. This is interesting because this has always been one of the reasons why I considered SWT so much better that Swing, the font rendering.

    I was also curious about the improvements that Java 6 would bring in this respect and I did pretty much the same experiment you did.

    I had to change a setting to enable text anti-aliasing in the Netbeans editor[1]. I wonder if you did the same?

    [1] Go to Options --> Editing --> Editor Settings. Then on the right pane under the Expert heading check "Text Antialiasing".

    ReplyDelete
  4. I think before posting trollish stuff in forums like javalobby.org I would inform myself.

    NetBeans does not work out of the box with Mustang's new font-rendering, since they set some own properties which override the SubPixel-AA property. There are already builds available which support mustang.

    Btw. if you've ever worked with Eclipse on other operating systems than windows you would know why SWT is a rather bad idea. I have to use Eclipse on GTK and its ugly and slow.

    ReplyDelete
  5. >> I have to use Eclipse on GTK and its ugly and slow.

    GTK is ugly to begin with. As far as using Eclipse on Linux is concerned (and I'm assuming you are talking about Linux) I've used both NetBeans and Eclipse on Fedora Core 3, Fedora Core 4, and Ubuntu 5.04 with Java 5 and they perform equally (fast or slow, it's your call).

    ReplyDelete
  6. I agree with some other commenters that mentioned that you should turn on/use AA in Netbeans before jumping to any conclusions.

    I also agree with the Javalobby guy about SWT on platforms other than Windows. It's broken on Mac OS X, and sub-par on Linux. SWT is okay if you're targeting Windows-only and don't care that much about cross-platform. If you're at all interested in good cross-platform apps, then Swing is the way to go.

    ReplyDelete
  7. Nice article Bill. I don't see what people are complaining about because you clearly state that you're using the production versions and that you feel like the situation will improve on the NB side. Besides, most of the article wasn't about NB or Eclipse anyway, but that seems to have touched a sensitive spot.

    ReplyDelete
  8. GTK is a widget API that has little to do with whether something is ugly. Your *theme* may be ugly but GTK isn't.

    Like it or not, Swing is using native rendering in 1.6 because SWT raised the bar for desktop Java applications. The competition is good for Java. The tired anti-SWT FUD is not.

    ReplyDelete
  9. Development builds of NetBeans 5.0 do use subpixel antialiasing and look great!

    ReplyDelete

Post a Comment

All comments are checked. Comment SPAM will be blocked and deleted.

Popular posts from this blog

cat-in-a-box channels greta garbo

So I'm sitting at my computer, when I start to notice a racket in back. I ignore it for a while until I hear a load "thump!", as if something had been dropped on the floor, followed by a lot of loud rattling. I turn around and see Lucy in the box just having a grand old time, rolling around and rattling that box a good one. I grab the GX1 and snap a few shots before she notices me and the camera, then leaps out and back into her chair (which used to be my chair before she decided it was her chair).

Just like caring for Katie my black Lab taught me about dogs, caring for Lucy is teaching me about cats. She finds me fascinating, as I do her. And she expresses great affection and love toward me without coaxing. I try to return the affection and love, but she is a cat, and she takes a bat at me on occasion, although I think that's just her being playful. She always has her claws in when she does that.

She sits next to me during the evening in her chair while I sit in mi…

first night for the gingersnaps

The first night has passed and the two have managed to survive, in spite of what their tiny hearts might have thought when first arriving. Greebo, the larger of the two, has been in hiding the entire time so far. Ponder has spent the time zipping in and out of hiding spots, checking things out, and learning just how comfortable pillows are for resting your head.

During the night I felt the tiny body of Ponder hitting the bed as he leaped up on the side, and then climbed to the top to run around on top of me. At least once he play-attacked my fingers. He might be small but his claws are still quite sharp.

When I got up in the morning the bowl of cat kitten food was fairly well depleted. It's been refilled and fresh water put in the big dish on the floor. I'm assuming that both Greebo and Ponder are feeding and drinking. I have seen Greebo under the furniture peeking out at me when I went looking for him. I'm leaving him alone while he continues to adjust.

So far the guys h…

vm networking problem fixed

Over the weekend I upgraded to Windows 8.1, then discovered that networking for the virtual machines wouldn't work. Then I tried something incredibly simple and fixed the problem.

Checking the system I noticed that three VMware Windows services weren't running; VMnetDHCP, VMUSBArbService, and VMwareNatService. VMware Player allows you to install, remove, or fix an existing installation. I chose to try fixing the installation, and that fixed the problem. The services were re-installed/restarted, and the virtual machines had networking again.

Once network connectivity was established there was exactly one updated file for Ubuntu 13.10, a data file. This underscores how solid and finished the release was this time. Every other version of every other Linux installation I've ever dealt with has always been succeeded by boatloads of updates after the initial installation. But not this time.

Everything is working properly on my notebook. All's right with the world.