Questions tagged [jtextarea]

A JTextArea is a multi-line area that displays plain text.

A JTextArea is a multi-line area that displays plain text.
It is intended to be a lightweight Java Swing component that provides source compatibility with the java.awt.TextArea class where it can reasonably do so.

2035 questions
0
votes
1 answer

Getting user input from JtextArea

public static void main(String[] args) throws IOException { //cevir("ornek3.txt"); JFrame frame=new JFrame("Print"); JPanel input=new JPanel(); JPanel output=new JPanel(); output.setBackground(Color.black); final JTextArea ita =…
How_To
  • 27
  • 2
  • 10
0
votes
0 answers

JTextArea---last charcter not selected

I am using JTextArea in a frame to show some text file, with following properties textArea.setLineWrap(true); textArea.setWrapStyleWord(true); The data in the file contains long lines(html headers and body stuff). Now when I try to select the text…
Jagga
  • 189
  • 2
  • 9
0
votes
2 answers

Displaying text from selected JRadioButton to JTextArea

I am working on my HOMEWORK (please don't do my work for me). I have 95% of it completed already. I am having trouble with this last bit though. I need to display the selected gender in the JTextArea. I must use the JRadioButton for gender…
Luis Ramos
  • 529
  • 1
  • 6
  • 13
0
votes
1 answer

I want to use Key Listener to listen for when I press enter in a JTextArea, but it isn't working

I made a JTextArea with a new Key Listener with this line in my class SetUp: startWin is from my Window class, and text is the JTextArea object in that class StrToInt is a method that converts a string to an int without using the parse methods …
0
votes
1 answer

Returning StringTokenizer to be able to setText on a Textarea

Dunno what to do, what is the best way to do this. this code is in my actionlistner for a button if clicked text = stringtokenizer(text); ta2.setText(text); ta2 is a textarea this is the method for stringtokenizer public static StringTokenizer…
0
votes
3 answers

JTextArea.select() does not select anything

I am having troubles using the select function of a JTextArea. I tested the variables with System.out.print() if they are filled correctly. Everything seems good but the select function does not work at all. public class exercises extends JFrame { …
Quatsch
  • 361
  • 1
  • 8
  • 29
0
votes
2 answers

Custom JButton with JTextArea component inside

I extended JButton so it would fit my needs. I have one JTextArea and two JLabel components inside of my new class. The problem is, that I cannot click through JTextArea. So, when mouse is in JTextArea bounds, the button is not responding. There is…
Mars
  • 867
  • 2
  • 13
  • 22
0
votes
2 answers

JTextPane should keeps position at update

I have a long text in a textPane (inside a scrollPane) that updates automatically. After update the pane scrolls to the top of the textPane. How can i deactivate the "top-scroll" (like the textArea does). I can not use a textArea because I style the…
Sheldon
  • 276
  • 3
  • 17
0
votes
2 answers

Read text and input file text to JTextArea

What's wrong with my code? I'm trying to read text file and then put the text to JTextArea, but its input only consists of the last line of text. What's wrong? Code: public void read() { int returnVal = fc.showOpenDialog(null); if…
Tadas
  • 89
  • 1
  • 6
0
votes
2 answers

Why my JTextArea is not displaying properly from the while loop?

My GUI application allows users to type into a JTextField object stating the name of a file to open and display its contents onto a JTextArea object. If the entered information consists of the file name then it shall retrieve its contents otherwise,…
Scorpiorian83
  • 469
  • 1
  • 4
  • 17
0
votes
2 answers

Reading last character entered from JTextArea

I am making a simple text editor in Java so that I can write programs. I am stuck on making an ActionListener that is activated whenever a space is entered. So, when you are typing into the text area and you press space, it will read the last word…
mgthomas99
  • 5,402
  • 3
  • 19
  • 21
0
votes
0 answers

JTableCellRenderer causing program to go black when minimized

I'm making a program that selects classes from a database via a jcombo box and then populates a time table with the class times. I've used a custom cellrenderer that extends DefaultTableCellRenderer to text wrap the information and change the…
0
votes
3 answers

JTextArea Filters and/or Inputs of time (00:00:00) Java

There's a section of my program where the user should have the ability to edit an amount of time. There will be a default amount of time already set but the user should be able to edit it if need be (00:00:00) Would a single line JTextArea with…
Oscar F
  • 323
  • 2
  • 9
  • 21
0
votes
1 answer

How to print symbols, non-alphanumeric characters in JTextArea

I want to print mathematical solutions, questions and answers, both in Bold and plain text in my JTextArea How do I print symbols like exponent 2, matrix symbols, etc? Something like this: What is the shortest, smartest way to accomplish this type…
Ingila Ejaz
  • 399
  • 7
  • 25
0
votes
2 answers

Using tables on a JTextArea

Am I not allowed to use an html table to print to a JTextArea? When I use the following code it prints the html code and doesn't format the tables. What do I do? This is probably a simple fix but since the question is so specific it would take me…
1 2 3
99
100