Eric Low

Ranch Hand
+ Follow
since Mar 14, 2002
Merit badge: grant badges
For More
http://www.geocities.com/lowyuenkong/
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Eric Low

This is GREAT... Thanks Ron.
22 years ago
Hi All,
I have always find Reqular Expression very useful in many circumstances. I wonder why isn't ReqEx part of the standard J@SE APIs?
Any idea?
Rgds
Eric Low
SCJP2
22 years ago
Hi All
Have no luck so far. I'm thinking of using Javascript to access the variable in the applet instead rite now.
I have tried something like this:

where getData() is a static method in the applet which returns a String object. However it's not working as well... please help!
Regards
Eric Low
SCJP2
22 years ago
Hi Renee,
Thanks, it works somehow!
However, this can not solve the problem of the PASTE action which by default insert a "newline" with the text!
Anyway, thanks a lot!
Cheers
Eric Low
SCJP2
22 years ago
Hi Rakesh
I have tried that as a GET request, but I want it to be a POST request instead.
Any idea?
Eric Low
SCJP2
22 years ago
Hi
How could I perform a post request(and redirect) to an action page from an applet?
I have tried the following:

The above doesn't seem to work properly, coz it is not "redirect" to the action page.
Please comment.
Cheers
Eric Low
SCJP2
22 years ago
Hi Renee,
Thanks for your reply.
As far as I am concern, CSS is used to "style" the presentation of the HTML document. What I really need is to change the "behavior" of JTextPane.
For e.g., I can think of 3 situations where <p></p> will be inserted "automatically":
1. By default, when the JTextPane is empty.
2. When user press [ENTER].
3. During PASTE action.
How can I change these "standard" behavior? I am developing a HTML editor meant for dumb user, that's why I want to make it to behave as close to, let say, MS Word.... i.e. again, the [ENTER] will trigger a single new line, NOT paragraph!
Please help me!
Eric Low
SCJP2
22 years ago
Hi All
I have just got a 2nd interview next Tuesday with the VP of a company, I am wondering what kinda questions shd I expect?
I took 2 hrs to take a technical exam during the first interview (>70 MCQs (Java/J2EE) and 4 snippets questions) and have talked to no one that day.
FYI, I like that company!
Any comments?
Cheers
Eric Low
22 years ago
How to change the behavior of JTextPane one and for all?
Actually, I am trying to develop a HTMLEditor and I want to make it to feel like normal text editor as close as possible... ie when user click [ENTER], a single line <br> should be inserted, instead of a paragraph <p></p>.
For the time being, I have managed to overwrite the [ENTER] action but this is not good enuf because this behavior also apply to PASTE action as well!
Any comment is appreciated. Thx in adv.
Rgds
Eric Low
SCJP2
22 years ago
Try this:

The above code basically detect the TAB keystroke in JTextPane and perform your "pre-defined" action instead.
Hope this helps.
Cheers
Eric Low
SCJP2
22 years ago
As far as I know, this can be easily handled with Swing, try this:

Hope this helps!
Rgds
Eric Low
SCJP2
22 years ago
Hi All,
I have found the answer, it's JRE ver problem, it happens only to v1.3.0, this has been fixed in 1.3.1.... please read :
http://forums.java.sun.com/thread.jsp?forum=57&thread=126795
Seeya!
Eric Low
SCJP2
22 years ago
To explain my intention, lets take a look into a portion of my code:

As shown above, basically, I am trying to insert <br> instead of <p> whenever the user press return. I have tried input :

to the JTextPane, then display the result to the JTextArea, what I get is

I am really confused!!??!?!?
Please help!
Eric Low
SCJP2
22 years ago
I am looking for the Unicode equivalent for <br> in JTextPane (with content-type set to "text/html").
Imagine:

And I want the above to print a <br> in the HTML. Does anyone has any idea?
22 years ago