Enter « JTextArea « Java Swing Q&A





1. JTextArea new line on shift + enter    stackoverflow.com

I've added a keylistener to my JTextArea field, but it doesn't behave as I expected.

inputTextArea.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent k) {
  //If the return button is hit, only set to ...

2. How to use enter instead of a button JTextArea?    stackoverflow.com

For some kind of messenger application I am using a JTextArea so I can type in multiple lines. But after looking at the documentation I see there is no action event ...

3. How to handle ENTER key event in JTextArea    coderanch.com

Welcome to the Ranch. Please confirm that you have got the correct displayed name. Not sure about your problem, and might not be able to help myself, but I think you would have better chances of a useful reply if you post more details, including a little code showing what you have written (use the "code" button below and ctrl-C ctrl-V ...

4. Disable enter/return key in JTextArea    java-forums.org

Hello, im working on a project where i ask people to type an announcement into a textarea and it saves it to a datafile, but if you click the enter key it moves down to the next line and when it saves it to my datafile it corrupts it, so i wanted to make it so they cant click enter and ...