/** * Converts the selected hexidecimal sequence to the equivalent characters. */ Selection[] selection = textArea.getSelection(); String s = textArea.getSelectedText(selection[0]).replaceAll("\\s",""); StringBuffer sb = new StringBuffer(); for (int i = 0; i+1 < s.length(); i += 2) { sb.append(""+(char) Integer.parseInt(s.substring(i,i+2),16)); } textArea.setSelectedText(selection[0],sb.toString());