Hi everyone,

I have a text area and a button on a frame and there's some text in the text area. What i need is when the user clicks the button whatever the text selected by the user in the text area and not all the text in the text area is bolded.

I am only using awt components and not any swing components.

Can someone show me or e-mail me a sample program or sample codings or part of the sample program on how this can be done.

My e-mail is freesoft_2000@yahoo.com

I really hope someone can help me.

Thank you

Yours Sincerely

Richard West

Recommended Answers

All 3 Replies

I think you can use getSelectedText and setSelectedText methods of text area. I dont know about the awt components but I use them in swing.

hi everyone,
I checked the JTextArea api and could not find the setSelectedText method that you mentioned. Am i missing something.
Maybe you can tell me where you found this api

Thank you

Your sincerely

Richard West

Oops !! that method was written by myself when I was making a word pad about two months ago... I searched for it but didnt find it ... I'll post it whenever I find it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.