![]() |
|
|
||||||
Recent ArticlesShould You Care About Requirements Engineering? Recently, I (Adil) was invited to participate in a one day seminar on the subject of Requirements Engineering. Whilst I have no direct experience of t ... Tips for Setting Up Your First Business Website To attract all potential customers to your business you need a presence on the web. The problem is that if you haven't set up a website before, you p ... LISP is a general-purpose programming language and is the second-oldest programming language still in use, but how much do you know about it? Did you ... Open Source Tools for Developers: Why They Matter From a developer's point of view use of open-source tools has advantages beyond the obvious economic ones. With the open-source database MySQL in mind ... An Interview with Norbert Cartagena An exclusive interview with Norbert Cartagena, the former editor-in-chief of Developer Shed Inc. and self-confessed fan of science fiction. In ... |
Unicode Character Chooser
Well, now, by using this component, you can easily add this functionality to your Java applications! For example, here is the demonstrator application showing the kinds of results that you can achieve ![]() And here is the dialog that you use to enter the unicode characters: ![]() The jar file that you download is an executable Jar file that contains, but also demonstrates, the Unicode Chooser. The demonstration is basically a JTextArea wrapped in a JFrame - it shows character insertion into a text component. From your application you could call the UnicodeChooser as follows:
JFrame frame;
JTextArea textArea;
UnicodeChooser chooser = UnicodeChooser.instance(frame);
...
chooser.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (UnicodeChooser.INSERT_CHARACTER_PROPERTY.equals(evt.getPropertyName())) {
Character symbol = (Character) evt.getNewValue();
if (symbol != null) {
textArea.insert(symbol.toString(),textArea.getCaretPosition());
}
}
}
});
chooser.setVisible(true);
It's as easy as that! Note that the Unicode Character chooser is modeless, so the user can leave the unicode chooser dialog open while working in a main text component. It also means that you can use the unicode character chooser to input words - or even sentences - of characters rather than just single characters Simon White |