| Author |
how to trap delete KeyEvent..
|
danish shaikh
Greenhorn
Joined: Nov 09, 2004
Posts: 21
|
|
Hi All, I m creating a Text Editor in Java.. I m new to Java n learnt by my own. 1> i have to redirect the keyEvent of BackSpace n delete keys.. i have successfully built the logic to redirect the back space key .. by first consuming it... But my problem is that the Delete Key event is not consuming i hav used the same logic for backspace but it working so plz help me the logic is.. public void keyPressed(KeyEvent ke) { int code=ke.getKeyCode(); if(code==KeyEvent.VK_BACK_SPACE && flag==true) consume=true; if(code==KeyEvent.VK_DELETE && flag==true) consume=true; } 2> i also wants to make the deleted word as a striked one but that too is not working whereas the same for underline attribute is working so plz help me.... StyleConstants.setUnderline(set, true); /// working StyleConstants.setStrikeThrough(set,true); ///not working plz help me its quite urgent...looking for ur replies.... Thanks in Advance...
|
 |
 |
|
|
subject: how to trap delete KeyEvent..
|
|
|