Question - SMP or TUR?
[B]//Add Listener. Put inside your GUI's constructor:[/B]
textBox.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
textBoxKeyReleased(evt);
}
});
//Put this in the main body of the GUI class:
//This method will be run whenever a key is released by the user.
private void textBoxKeyReleased(java.awt.event.KeyEvent evt) {
if (useSyntaxColorsCheckBox.isSelected())
syntaxObj1.styleAsmCodeInLine(textBox,textBox.getCaretPosition());
}
[B]//Remove paste action. Put inside your GUI's constructor:[/B]
textBox.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_V,
KeyEvent.CTRL_MASK),"none");
//Class field declaration follows. Put in main body of GUI class.
paste = new javax.swing.JMenuItem();
[B]//Create new shortcut Ctrl+V for custom paste option. Put inside your GUI's constructor:[/B]
paste.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
paste.setText("Paste");
paste.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
pasteActionPerformed(evt);
}
});
editMenu.add(paste);
//This method is the custom paste option.
//First it makes the text pane visible,
//then it performs a paste.
//Finally, it recolors the syntax.
private void pasteActionPerformed(java.awt.event.ActionEvent evt) {
makeTextBoxVisible();
textBox.paste();
refreshSyntaxColorationBasedOnCheckBox();
}
What does that even meanRoyaltyler said:Yo on red flowers yo!!!