Link to home
Start Free TrialLog in
Avatar of finance_teacher
finance_teacher

asked on

JAVA -- Textbox "KeyPress" EVENT on two textboxes

I have two textboxes (TextBox1 & TextBox2)

Convert below C# code into JAVA
so I can use this one "TextBox_KeyPress"
EVENT on both textboxes.
------------------------------------------------------------  
private void TextBox_KeyPress(
      System.Object sender, KeyPressEventArgs e)
    {
      if (Char.IsLetter(e.KeyChar) && Char.IsLower(e.KeyChar)
        || char.IsWhiteSpace(e.KeyChar))
      {
        ((TextBox)sender).AppendText(
          Char.ToUpper(e.KeyChar).ToString());
        e.Handled = true;
      }
    }
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial