Still working on the text simulation thing, which, again, is meant more to expand my knowledge than to be practical or useful. Newest development: all basic text keys are usable (including letters, numbers, and single-keystroke punctuation and symbols).
I also figured out how to work with a backspace function - it was just simpler than I had expected. The code looks something like:
Switch (keycode) ** which works like an if clause**
{
case KeyEvent VK_BACK_SPACE: **activates when backspace is used**
welcomeJTextArea.replaceRange( **this tells it to replace
"", welcomeJTextArea.getText().length - 1, the text in the previous
welcomeJTextArea.getText().length ); spot with a blank**
blinkx -= 17; **moves the cursor back**
break; **ends the statement**
I also simplified the code that activates for each keystroke by consolidating the "blinkx += 17" statements (which move the cursor forward) into one statement.
Tuesday, April 15, 2008
Thursday, April 3, 2008
more stuff
currently, i'm experimenting with graphics environments and user interactivity, especially with actionlisteners and keylisteners at the moment. i'm also using timers and the like.
Subscribe to:
Posts (Atom)