| |

VerySource

 Forgot password?
 Register
Search
View: 986|Reply: 7

jTextArea problem

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-11-26 15:30:02
| Show all posts |Read mode
Excuse me, can the jTextArea class delete a row of data.
For example, the data inside
132
231
125
134
321
How can I delete the line "134"?
Thanks for a piece of code. anxious
Waiting online
Reply

Use magic Report

0

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Invalid IP Address

Post time: 2020-11-27 20:15:01
| Show all posts
If jTextArea is editable, delete it manually
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-11-28 00:45:01
| Show all posts
That said upstairs. It seems that I have not seen an example of deleting a specific line in a textarea, and the list is almost the same...
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-11-28 01:00:01
| Show all posts
By the way, if you just want to implement this function, you can clear the textarea first, then create a new string, delete that line in the string, and then settext() in the textarea.
Reply

Use magic Report

0

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Singapore

Post time: 2020-11-28 01:45:01
| Show all posts
If you need to update such a string of String in real time, I think it would be more appropriate to use JList.
You can store the data in a List, and then let JList update the content in the List in real time. You only need to add or delete data from the List.
Reply

Use magic Report

1

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-11-28 08:30:01
| Show all posts
Agree, JList is generally used for striped display, textarea is generally used to display a large section of string with little change in content
Reply

Use magic Report

1

Threads

12

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 Invalid IP Address

Post time: 2020-11-28 09:45:01
| Show all posts
mark
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-11-28 14:30:01
| Show all posts
Thank you, finished with list,
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list