Tag Archives: Java

JavaFX Still Not Ready?

Just a short rant about JavaFX because I’m pissed about it at the moment. I enjoy using it for the most part but it sometimes throws up surprising obstacles in otherwise routine work. The latest for me was an unexpected lack of a spinner control. There are alternatives in some open source projects, but, really? No spinners built in?

This is almost as gob-smacking weird as the lack of dialogs. (Ok, there are some dialogs, like for opening/saving files, but not much in the way of user-programmable dialogs built in.)

And don’t get me started about the odd placement of the run time library. It seems to change with every few releases. Always having to put in some kludgy version-dependent stuff to find the libraries.

Maybe it will all be fixed in version 8.

Paths with Spaces, I Give Up

I’ve wanted to look into the Pedestal framework for creating web-based applications in Clojure. However, one of the requirements is Leiningen 2.2.0 or greater. And, as I’ve written before, version 2.2 will not install on my system because of spaces in the path of the user home directory. (“C:\Users\David Clark” on my system.)

My user profile name is “david”. That’s what I use to sign on with. The fact that my home directory uses “David Clark” is an unfortunate result of how the computer was set up at the factory when I custom ordered it. This has been a periodic pain in the ass ever since I got the system because folks who develop tools primarily on other operating systems, just can’t seem to deal with spaces in file paths. Even after all these years. It’s a kind of snobbery that I just find annoying and trite. Windows exists. Get over it.

Rather than try to fix every program that screws this up, I decided to change my user account and profile to just use “C:\Users\david” as my home directory. Not so easy.

Continue reading

Java-Clojure Interop: An Update

My most popular answer on Stack Overflow has to do with Clojure-Java interop. Since that answer was written, some of the tools used in the answer, specifically enclojure, have been deprecated. Because many of the follow-up questions related to how to build a working version of the answer, I thought it might be a good idea to update the post with modern tools.

Default JavaFX Platform in NetBeans

Every time I update the default JDK used by NetBeans, I also want to update the default JavaFX platform. And I always forget how. Looking on the web usually results in finding methods that just don’t work. Here’s how I do it.

  1. In NetBeans (7.3 as of this writing), select the “Tools” menu and the “Java Platforms” drop-down menu.
  2. In the left pane of the dialog, select “Default JavaFX Platform” and remove it. Close the dialog by clicking the “Close” button.
  3. From the “File” menu, select “New Project…”
  4. Create a new “JavaFX Application”, then complete the wizard using the defaults supplied.

That will reset the Default JavaFX Platform to point to the version included in the latest JDK.

Keyboard Shortcuts for JavaFX Buttons

Most programs written for graphical user interfaces still provide a way to operate with the keyboard, requiring minimal mouse usage. The thought is that expert users will want to speed through their work keeping their fingers on the keyboard rather than devote an entire hands worth of fingers to controlling the mouse. I’ve been learning JavaFX, the eventual replacement for the Swing UI framework on Java, and wanted to explore how shortcut functionality had changed. There were a few tutorials on keyboard shortcuts for menu-driven programs, but nothing I could find on their use with button-based interfaces. That’s what I cover here.

Continue reading

JavaFX KeyCodeCombinations in Clojure

I’ve been experimenting with adding keyboard accelerators to some of the Clojure programs I’ve written with JavaFX-based user interfaces. As part of that investigation, I tried to translate the Java program here to Clojure. The program just puts up a window with a menu bar containing only a “File” menu which itself contains one item, “Exit“. Most programs provide a keyboard shortcut or accelerator to close the program with a Ctrl-X (on Windows). Figuring out how to add that functionality was a bit of an issue for me.

Continue reading

Re-sizing an Interface in JavaFX and Clojure

Since JavaFX is the future of the user interface for Java, I’ve started trying to learn it. Since I’m also learning Clojure, I’m doing the work in that language.

One of the things I’ve been looking into is how the interface responds to resizing. If you have all of your controls in a nice layout, that is usually taken care of for you. But how do you handle things if the interface is not made up of standard components, something like a graphical game interface for example?

Continue reading

Wilcoxon Matched Pairs

At my previous employer, our goal was to stain tissue samples such that a pathologist could examine them microscopically and easily make unambiguous diagnoses of disease state. Experiments typically involved getting subjective judgements from pathologists about which samples were “better” in some way. How do you do statistics on those type of results?

Continue reading

Java Data Grid Component — A Personal Failing

Many of the programs I write need a way to enter and edit a two-dimensional grid of data in the user interface. Such a grid doesn’t need to be a full-fledged spreadsheet, just provide flexible data entry and editing. Alas, there doesn’t seem to be such a thing and I haven’t created one that I’m satisfied with.

Continue reading