| |

VerySource

 Forgot password?
 Register
Search
View: 885|Reply: 2

Question about Text component displaying String in SWT

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Great Britain

Post time: 2020-1-21 18:00:02
| Show all posts |Read mode
Very strange, I don't know if it is a problem with the insert method of the Text class. I can use System.out.println to output it normally in the Console window, but I insert this String into the insert and insert a Text text box. : Strings that start with spaces cannot be displayed! What the hell is going on? How can it be displayed properly? Urgent use, please help friends, thank you!
Reply

Use magic Report

0

Threads

4

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-4 17:30:01
| Show all posts
How do you insert your String type string into the txt text box? Is it new JTextField("String") or new JTextField().setText("String") or other methods?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-4 18:30:01
| Show all posts
Use append() method
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