private void mouseReplaceText(String text,int index){
  Font font=charMap4.getDisplayFont();
  if (font != null) {
    selectedFont=font.getFontName();
    selectedChar=index;
    String displayText=String.format("ttf://%s#%s",font.getFontName(),text);
    charMap4.setSelectedCharacter(displayText);
  }
}

private void mouseReplaceText ( String text , int index ) { Font font = charMap4 . getDisplayFont ( ) ; if ( font != null ) { selectedFont = font . getFontName ( ) ; selectedChar = index ; String displayText = String . format ( "ttf://%s#%s" , font . getFontName ( ) , text ) ; charMap4 . setSelectedCharacter ( displayText ) ; } }
mouse replace text . after a mouse click , or the pop - up menu simulating a mouse click , call this method with a string to be added to the sample text .
