The list of methods to do JTextComponent Select are organized into topic(s).
boolean
isSelectionUpperCase(JTextComponent textPane) is Selection Upper Case
String text = textPane.getSelectedText();
byte[] bytes = text.getBytes();
for (int i = 0; i < bytes.length; i++) {
if (Character.isLowerCase((char) bytes[i])) {
return false;
return true;
...
void
selectionToUpperCase(JTextComponent textPane) selection To Upper Case
int start = textPane.getSelectionStart();
int end = textPane.getSelectionEnd();
if (Math.abs(start - end) > 0) {
String upper = textPane.getSelectedText().toUpperCase();
textPane.replaceSelection(upper);
textPane.setCaretPosition(start);
textPane.moveCaretPosition(end);