Frequently Asked Questions

How do I get j to use the ISO-8859-2 encoding when loading and saving files?

Add the following line to your preferences file:

    defaultEncoding = ISO8859_2

What's up with the Tab key?

In programming modes (including Java, JavaScript, C, C++, PHP, Python, HTML, and XML), the Tab key is mapped by default to the command tab. The default behavior of this command is to re-indent the current line according to j's idea of correct indentation.

If you want to get rid of this behavior, you can create a custom key map for the mode in question that maps the Tab key to insertTab (see Key Mappings). You might also want to map some other key to indentLineOrRegion, which provides the re-indentation functionality assigned by default to the Tab key.

A less radical step is to add the following line to your preferences file:

    tabAlwaysIndent = false
If tabAlwaysIndent is false, the behavior of the tab command depends on the location of the caret. If the caret is at the very beginning of the text on the line, or in the whitespace to the left of the text, tab calls indentLine. If the caret is in the midst of the actual text on the line, tab inserts either a single tab character or the equivalent number of spaces, depending on the setting of the useTabs property.

tabAlwaysIndent is true by default.

tabAlwaysIndent is a mode-specific property, so you can set it for a specific mode if that's what you want:

    JavaMode.tabAlwaysIndent = false

Why don't certain keys work in j?

There is no single answer to this question.

There are known bugs on specific platforms with specific versions of Java and certain keyboards (German, Swedish, and possibly others). If you suspect that this is your problem, you might try switching to another version of Java. On Linux, IBM 1.3 seems to have the fewest problems, and Blackdown's version of 1.3 seems to be better than Sun's. But your mileage may vary. In any case, if the key in question doesn't work with the Swing Notepad demo, there's not much chance that it will work in j. Complain to your Java vendor!

If the key in question works with the Swing Notepad demo but does not work with j, please let me know. Be sure to mention what platform you're running on, what version of Java you're using, and your locale.

The command insertKeyText may be useful in debugging keyboard problems.

When selecting text with the keyboard, if I want to select multiple lines, the first line is always selected completely. If I just want to select part of the first line, I've got to do it with the mouse.

That's not a bug, that's a feature (really). The idea is that selecting whole lines is the more common case when the selection spans multiple lines, so j tries to save you an extra keystroke in that situation.

When you just want to select part of the text on the first line, you can use the left or right arrow key to select a single character first, and then use the up or down key to extend the selection. This costs you an extra keystroke, but it's the less common case. Or at least that's the idea.

If you don't like this behavior, you can disable it by adding the following line to your preferences file:

    autoSelectLine = false

I just upgraded to Mac OS X 10.2, and now j has odd display problems.

It may help to disable hardware acceleration when starting j:

    java -jar j.jar