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.KeyCha r))
{
((TextBox)sender).AppendTe xt(
Char.ToUpper(e.KeyChar).To String());
e.Handled = true;
}
}
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.KeyCha
{
((TextBox)sender).AppendTe
Char.ToUpper(e.KeyChar).To
e.Handled = true;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.