
Morning sir,
Can you help me, i want to make a automatic capital letter. I have a jTextfield1, if i type aaaaaa ,it will be automatic AAAAAA. can you help me give a source code. Thank you very much.
regards, Hendra

Here is an example that change the case of characters to uppercase as the user enters any character.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class TextFieldExample extends JFrame{
JTextField text;
JLabel label;
JPanel p;
TextFieldExample(){
text=new JTextField(15);
label=new JLabel("Enter String:");
p=new JPanel();
p.add(label);
p.add(text);
text.addKeyListener(new KeyAdapter(){
public void keyReleased(KeyEvent e){
String st=text.getText();
text.setText(st.toUpperCase());
}
});
add(p);
setVisible(true);
setSize(300,100);
}
public static void main(String[]args){
TextFieldExample v=new TextFieldExample();
}
}

ok thank you sir
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.