Boa noite, faz dias que estou pesquisando na internet alguma maneira de criar aqueles botões de ITALICO, NEGRITO, SUBLINHADO, CENTRALIZADO, etc… mas não estou conseguindo mesmo usando o text/html do jTextPane/jEditorPane…
A minha pergunta é: Existe algum plugin que tenha a mesma função do TinyMCE para usar em aplicação desktop?
Obrigado
Pessoal crieu um botao para setar o valor selecionado dentro de um jEditorPane como negrito da seguinte forma:
variaveis:
String caminho,texto,ini,selecaoStr = null, textoForaSelecao1 = null,textoForaSelecao2 = null;
código dentro do jButton
[code] if (!jEditorPane1.getSelectedText().equals("")) {
ini = jEditorPane1.getText().substring(0, jEditorPane1.getSelectionStart());
if (ini.length()==0||!ini.substring(ini.length() - 3).equals("")) {
textoForaSelecao1 = jEditorPane1.getText().substring(0, jEditorPane1.getSelectionStart());
textoForaSelecao2 = jEditorPane1.getText().substring(jEditorPane1.getSelectionEnd(), jEditorPane1.getText().length());
selecaoStr = jEditorPane1.getSelectedText();
// Agora com o replaceAll, colocar as tags definidas em negrito
selecaoStr = selecaoStr.replaceAll(selecaoStr, "<b>" + selecaoStr + "</b>");
texto = textoForaSelecao1 + selecaoStr + textoForaSelecao2;
jEditorPane1.setText(texto);
} [/code]
mas só funciona bem se o jEditorPane ficar setado como “text/Plain”, se ei deixar setado como “text/Html” ele loqueia!
tem alguma maneira de funcionar bem???
Por favor alguém pra me tirar desse problema???
Obrigado desde já