Skip to content
Advertisement

Tag: jtextarea

Java – JTextArea refuses to print strings that are just whitespace [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last year. Improve this question I have written a command terminal using Swing components. The snippets of code below

How can I add a scroll bar to a text area?

Please, anyone, tell me how to add the scrollbar to a JTextArea. I tried out many things. but still not able to get it. I copied some codes related to the text area. Answer Oracle has a helpful tutorial, Creating a GUI With Swing. Skip the Netbeans section. As Andrew said, you have to place the JTextArea inside of a

How can make a JTextArea?

I am trying to make a textArea for my input, but it broke my code. It does not draw the characters or grid any more, and all I see is a small button in the top right corner. Screenshot of output Here’s my code with the JTextArea: What can I do to make my code work with the JTextArea? I

JScrollPane doesn’t show up in JFrame

there. I’m writing a GUI chat client which sends message to the server and receives echoes from the server. The top half of the client JFrame contains a JTextArea wrapped in a JScrollPane which is placed under the menubar. This JScrollPane is responsible for receiving responses from the server which receives messages from a client and broadcast it out to

Is there anyway to get the size of the text in a JTextArea?

The title pretty much says it all. What I don’t mean is how to get the size of the JTextArea. I need to get the size of the actual text. I am completely open to suggestions though. If you have a wonky workaround that involves using something other than JTextArea but still has a similar effect, I’d love to hear

Java GUI Calculator

My JTextArea does not display and no errors or problems shows up. It’s a Java GUI Calculator. Main class code: Calculator code: Any suggestions on improvements to the code? Answer You’re adding your JTextArea, text, to your screen JPanel, but you’re adding screen to nothing, and so it makes complete sense that the JTextArea won’t show. You should add the

Set row height depend on JTextArea height

I have a problem and really don’t know how to solve it. I used some solutions from this forum but they don’t work. This is the piece of code: This is little bit long but rather simple: my table uses custom cell renderer which contains JTextArea. I use JTA because I need Strings wrapping. After put such JTextAreas I expect

Advertisement