Category Archives: Programming

Focus Behavior Change between JavaFX 2 and JavaFX 8 when Selecting Rows in a TableView

For a little while now, I’ve been working on an application that manages a list of documents, providing multiple views that the user can edit.

The application looks something like this:



The user selects the document they wish to view or edit by selecting it from the large TableView in the middle of the window. The area on the right provides controls to view and edit details. (The area on the left is for filtering the documents displayed in the central table.)

Based on some early advice, I had watchers on the focus property of the fields that could be edited. When a control lost focus, any changes were written to the database. The user didn’t have to do anything to save their work. It just happened.

This worked with Java 7 and JavaFX 2. After the switch to Java 8 and JavaFX 8, things were not quite the same. If a user was making a change somewhere and then selected another document without moving to another editing view, the data was lost. The focus change notification did not arrive before the new document was selected in the table (repopulating the editing control before the data was saved.)

Continue reading

Overwhelming Java’s Swing

An odd thing happened recently. I have been working on a simulation that produces graphical and text updates as it progresses. That involves drawing a picture of the system and updating some textual elements of the user interface.

Things seemed to work fine when the simulation was run with “normal” inputs. However, when supplied with a set of parameters to produce a much simpler simulation, the user interface essentially locked up.

Continue reading

Editor Productivity

I’ve been away awhile, working on a new project. It’s part of an educational effort about molecular dynamics simulation. Although I’ve been working a lot with Clojure using emacs for editing, this project required a return to Java. As a result, I’ve been using NetBeans again. The difference in productivity was amazing and not in the way I expected.

Continue reading

Moving to Web Apps (or not)

I’m a desktop kind of guy. I prefer desktop PCs, desktop programs, desktop programming. But I am also a cross-platform guy. Hence my interest in Java, and by extension, Clojure. But I would like those things to run on my tablet and (other people’s) phone. Doing that with Java seems to be more work than it is worth.

Hence, I’ve been considering web apps as a possible future direction. (Seems everyone else has figured this out already.) For the past couple of months, I’ve been looking at JavaScript as a possible avenue forward. After this small amount of exposure I just have to say “Yuck!” I can’t believe in this day and age that JavaScript is considered a real language. It seems like an ad hoc collection of syntactic flotsam held together with bubble gum and duct tape. Much nastier than even BASIC. Probably worse than PHP. (Might still be better than Perl.)

So how to proceed? Seems like ClojureScript might be a good path. It would let me write in a language I like, but the build process is a bit arcane and seems a little fragile. And there seem to be a lot of gotchas about what parts of Clojure are actually supported. Or maybe just go with a full-blown Lisp. The Racket version of Scheme seems really nice.

Any other impressions would be welcome.

Another Program I’d Like to Find/Write

As I’ve mentioned before, I use several cloud storage services. However, being a cheap bastard, I have only signed up for free accounts up to now. That means I have lots of little bits of storage scattered here and there (although recently Box gave me 50GB free and my Copy account has risen to 25GB). But that means having to keep track of where I put certain things. It sure would be nice to have a program that would aggregate all these little pieces into a single thing.

Aggregation into something like the storage pools of the ZFS file system would be ideal. Having the ability to configure redundancy and RAID-like capabilities would be icing. Additional requirements would include cross platform operation and strong encryption on the client side.

Of course, using multiple cloud services would introduce more possible sources of failure. What should the system do if one of the services goes down? What should the system do if one of the services decides to shut down? More complications.

Such a program would have to understand the API of each service. That would be another great project — developing a library that abstracts away the differences between services — basically a ZFS-like file system for the cloud.

Why have I not written such a thing myself? As I have whined about before, I spent the last 30 – 40 years writing desktop and embedded systems. Not too much work on web-based applications. Although I’m learning, I would rather have such an application before I have the skill to write it. Any takers?

Saving/Restoring Program Configuration across Sessions in Clojure

I like to use programs that can remember what I was doing the last time I was working with them. They should restore the window just as I had it, remember which file(s) I was working with, what preferences I had selected, and so on. Naturally, I want the programs I write to be just as considerate of the user.

For some time, I’ve been fretting over the best way to do this in a Clojure program. Should I provide wrappers around the Java Preferences API? Some other mechanism? Turns out I should just embrace simplicity.

Continue reading