I have a JTextField and I’m using it to put info into a JTextArea. I want a command that puts text into it, but I’m having to use split to check if it’s the /text command. When I do “/text Message To Put”, it cuts off at the spaces. How can I get the “Message to put” as a whole to output to the JTextArea?
Share
You can do something similar to the following to parse the text that is in the
JTextField.The above just looks to see if the text starts with
/textand, if if does, it trims the/textoff of the beginning and leaves you with only the message.