import javax.swing.*;
public class JTextFieldTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame f = new JFrame();
JTextField field = new JTextField(20);
f.add(field);
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
});
}
}
To reproduce, run the attached sample application. Make sure Japanese is
added to the list of input sources in OS settings. Choose Romaji input
method, then press backslash ( \ ) key on the keyboard.
Expected result: yen symbol is entered in the text field (this is the effect
observed in native applications).
Actual result: backslash is entered.
The issue is reproduced with latest macOS (10.13.1) and latest Java (9.0.1)
versions.