Damithri Warnakulasuriya

Greenhorn
+ Follow
since Apr 18, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Damithri Warnakulasuriya

JTextpane is for user to enter a message and send.
So user uses Enter key when he wants to move in to the next line.

Then ultimately the each new line is wraped by a <P> tag. I want to wrap it by <br>.





12 years ago
Hi

I'm using a JTextPane and content type is set to "text/html".
Each line that I have separated by Enter Key is by default within a <P> tag and therefore the content of the JTextPane creates unnecessary spaces between lines.
Does anyone know to ignore those <P> tags or to replace those by <br> tags by setting a property of JTextPane

Thanks

12 years ago
Hi All,

Firstly I wish you all a very happy new year.

I have done a sun certified java programmer examination in 05th June 2006. Now I feel to do the SCWCD and SCBCD and at least the first step of architect exam within four months. So to achieve this goal i am planning to quit my current job as well.

So as I guess you guys are all java professionals. So before getting my decision to quit from my current job i like have ideas, suggestions and the validity of these certification in the global industry. Your help might give me a better future.

cheers
Hi All

I want to make first letter of each word to be in Uppercase. So now I'm using a a tokenizer and I tokenized using a space (" ") character.
But the problem is if someone types something and presses enter key it goes to the next line but the first letter is still be in lower case as it is not tokenzed.

How can I handle this situation.

Please help me

Thank you
13 years ago
Oh Thank you very much for the early reply. Thanks for the help as well.
13 years ago
Hi All,
Is anyone knows, how to disable enter key for JTextArea?

If someone types something in a JTextArea and presses Enter key, then cursor goes down (Starts a new line).
What I want is to disable that action and cursor should be as it is without moving to a new line when user presses the enter key.

Please help me.

Thank you
13 years ago
Hi
With the permission I've changed the old code. Removed KeyListener and Focus Listener and added the DocumentListener as you said. Now it is working properly.
Thank you very much for the great great help.
Again Thanks a lot
13 years ago
You mean to switch in to InputMethodListener. No I'm unable to do that. Because the previous guy has implemented focus listener methods in another class and here also he has done it as follows
FormatAction formatAction = new FormatAction();
nameTextField.addFocusListener( formatAction );


NameFormatAction class is the place where he has implemented focus listener methods and if I changed it to another listener, classes that are using NameFormatAction also has to be changed and it 'll be a big issue.
13 years ago
Hi.
The person who worked with this code earlier had added this focus listener to do some sort of validation. So it is needed to keep that listener as i do not have permission to modify the previous code.
So if i use the setComponentPopupMenu method, again i need the selected text. But because of the focus listener i'm unable to do it.
So i need a way to select text without removing the focus listener
thank you.
13 years ago
Hi Maneesh
thank you very much for the early reply. I use popup menu to get copy past and cut commands. But when i write something and select some text to copy then i write click the mouse to get the popup menu to select copy command the earlier selected text is no longer highlighted. So it passes null to copy and doesn't do anything.
That is because when i press the mouse again focus listener takes place.
What i want is to keep the selected text till it calls my popup listener. I'm sorry I have no idea that which part of my code to send you as it is too long.
If you can tell me the part you want to give a solution I'll send you soon.
Thank you
13 years ago
Hi all
I'm using a JTextField with three listeners as follows for three different purposes


nameTextField.addKeyListener( formatAction );
nameTextField.addFocusListener( formatAction );
nameTextField.addMouseListener(popupListener);

But the last one is working only if I comment the first two lines. Could anyone please suggest me a way to have three listeners work together.

Thanks
13 years ago
Hi

I have a JScrollPane and there is a JPanel within it. Within that particular JPanel I'm setting JEditorPanes dynamicaly. I want to get the scroll bar to the top as I'm getting it in the midle now.

Could anyone please help me
13 years ago