I made a .pxtone, and I was wondering how I could improve upon it. Could you provide some advice?
It's in the PxTone creations thread.
Many thanks.
It's in the PxTone creations thread.
Many thanks.
Noxid said:How should I set up a JTextPane so that the syntax highlighter can re-colour it when you change the text by typing or pasting something or whatever?
private void textBoxKeyReleased(java.awt.event.KeyEvent evt) {
if (useSyntaxColorsCheckBox.isSelected())
[COLOR="DarkGreen"]syntaxObj1.styleAsmCodeInLine(textBox,textBox.getCaretPosition());[/COLOR]
}
[B]//INSIDE THE CONSTRUCTOR FOR THE GUI:[/B]
//Override the paste action (Ctrl+V) with our own system of handling
//pasting. We need a custom paste action for syntax coloration.
textBox.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_V,
KeyEvent.CTRL_MASK),"none");
private void pasteActionPerformed(java.awt.event.ActionEvent evt) {
if (isIndentEditorSelected()) {
makeIndentBoxVisible();
indentEditorPane.paste();
} else {
makeTextBoxVisible();
textBox.paste();
}
[COLOR="Green"]refreshSyntaxColorationBasedOnCheckBox();[/COLOR]
}