Alvin Alexander | Java, Scala, Unix, Perl, Mac OS X

I just read this quote from Steve Jobs:

"People don't understand that we've invented a new class of interface," he said ... "there are no 'verbs' in the iPhone interface", he said, alluding to the way a standard mouse or stylus system works.

"In those systems, users select an object, like a photo, and then separately select an action, or 'verb', to do something to it."

As general-purpose text editors go, TextMate on Mac OS X is probably one of the best I've ever used. Favorite features are the built-in spell-checking, solid macro support, and a clean UI that stays out of the way. It also offers syntax highlighting for many different languages out of the box, which is nice when because I work in HTML, Java, and Ruby a lot. Smart tabs generally work very well also.

Looks like a fun day in the tech world. First, there's a robot that cleans the gutters. Next, Gateway (I thought they were dead) comes out with a new iMac competitor. That's a cool jump from the old cow boxes to a new PC leader in industrial design.

I was going to write a little tutorial on how to use the Jar Bundler Ant task for Mac OS X, but I don't have the time to do that right now.

So, I'll just share my Mac OS X Java Ant build script, which includes the JarBundler task. You should be able to use this Ant build script to build a Java application so it appears to the user to be a native Mac OS X application, even though it's really a Java application under the covers.

If you ever get the following error message in an AppleScript program (at least while editing the program in the ScriptEditor):

Can't make (handler) into type string

fear not, it seems to be pretty simple to cure. In my case I got this more-specific error message:

Can't make (handler getDayOfWeek) into type string

This error just means that I tried to call a function like this:

To sort a Unix / Linux directory listing by file size, you just need to add one or more options to the base ls. On Mac OS X (which runs a form of Unix) this command works for me:

ls -alS

That lists the files in order, from largest to smallest. To reverse the listing so it shows smallest to largest, just add the 'r' option to that command:

ls -alSr

 

Question: In a Java Swing application I open a JFrame that displays some contents in a JTextArea, and has a Close button (a JButton) at the bottom of the JFrame. I've tried a lot of things, but I can't get initial focus on that JButton component. This is happening on a Mac OS X system, but I'll assume it has the same problem on Windows. Any suggestions?

If you need to create icons for an application on a Mac OS X system, Apple provides a small application named "Icon Composer". If you have the Xcode tools installed, this application is in the /Developer/Applications/Utilites/Icon Composer folder on your system. (Choose Macintosh HD, then Developer, Applications, Utilities, and then the Icon Composer application.) More to the point, this utility program helps you create icons in Apple's "icns" format from icon images in other formats.

I just had a problem using Ant on Mac OS X 10.4.x. As I was trying to get the jarbundler task to run, the jarbundler help text said to copy the jarbundler.jar file to the /Developer/Java/Ant/lib directory. Turns out this isn't right for my system, but I didn't know where Ant was getting its libraries from.

My exact error was:

taskdef class net.sourceforge.jarbundler.JarBundler cannot be found

Fortunately the following Ant command gave me all the output I needed, and much more:

I recently purchased an Acer X191W monitor, a flat-screen 19 inch monitor. While I have no complaints about the screen itself -- it's a very good picture -- the design of the stand is horrible. There is absolutely no flexibility at all in positioning the angle of the monitor. To get around this problem I currently have it resting on top of two books, with a deck of cards under the front portion of the monitor stand so it will tilt back to an angle that works well for me. I've never had a monitor that was this inflexible.

I just finished a short tutorial on using an open source JDBC framework named SQLProcessor. The SQLProcessor is a facade for some of the JDBC API. It's very cool on a variety of levels, including reducing coding errors, simplifying your Java code, and providing great debug output. The tutorial is available here.

 

I just posted a new tutorial titled How to bundle a Mac Java application on Mac OS X using Xcode's Jar Bundler. This tutorial demonstrates how to use the Mac OS X Jar Bundler utility to configure a Java application to install like a native Mac application, and look right in the Finder, the Dock, and the Get Info window. It also starts to look at using an Ant task to automate the bundling process.

 

I know that a lot of people who used previous versions of iMovie don't like iMovie '08, but as someone just getting started in creating and editing videos, I find it to be very easy to use, and seems to work the way I think. Step 1, load my video files. Step 2, extract clips from existing videos to create the desired video, add effects, etc.

Mac Mighty Mouse FAQ: Help, my Apple wireless Mighty Mouse clicks but won't track properly; what's going on?

I’ve had a lot of problems with batteries with my Apple Bluetooth (wireless) Mighty Mouse, including this “tracking” problem, but fortunately everything just came to a happy conclusion.

Mac Olympus DS-30 review: Here's my quick take on the Olympus DS-30, from the perspective of a Mac user.

If anyone is looking at an Olympus DS-30 voice recorder, and wondering if it will work with Mac OS X (in particular for making podcasts), the answer is both yes and no (with a little extra emphasis on the "no").

Summary: The Toyota RAV, 2006 model and newer, have become famous for a steering column klunking sound. Toyota then saddles the RAV4 owner with an $800 repair bill.

The question is, why isn't there a Toyota recall on this steering column klunking sound problem?

As I continue working on a text editor built for an audience of one (me) I've written a tutorial on how to make a Java/Swing application look like a native Mac OS X application.

My goal is to take this as far as I can, trying to make a complicated Java application look and feel like a Mac Cocoa application, but, I want to do this without severely compromising the cross-platform benefits of Java.

Mac ISO burning FAQ: How do I burn an ISO image on Mac OS X?

It seems like lately all I'm doing is burning stuff to a CD or DVD on my Mac OS X system, first backups, and now I'm burning ISO images.

If you've never burned an ISO image to a CD or DVD on a Mac before, it's pretty easy. Here's how I just burned a Fedora ISO image on my MacBook Pro, which is a Mac OS X 10.4.10 system.

Wow, I missed this news from last year: the Mac OS X Cocoa-Java API is deprecated.

I know that when I was reading Cocoa Programming for Mac OS X earlier this year the author (Hillegass) said not to use it, but I didn't realize it was a total no-no. As the first link says, use JNI instead.

 

Mac OS X Finder FAQ: What keyboard shortcuts can I use with the Mac OS X Finder?

Mac OS X Finder keyboard shortcuts (keystrokes)

Wow, once I learned a few Mac OS X Finder keyboard shortcuts, I like the Finder much more. It was freaking me out that the [Enter] key doesn’t actually open a file or directory, it just lets you change the name. The keystrokes are much different than Windows, and it takes a while to get used to them. But once you start using them, they’re easy to remember.