ego hu

Ranch Hand
+ Follow
since Mar 20, 2001
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 ego hu

I am learning Java servlets. So I downloaded J2EE SDK1.3.
When I launched j2ee server, it involves apache web server
and tomcat automatically.
Then I copied a "Hello world" serlet sample, and compiled it.
But I don't know where I should put the .class file.
The file structure of j2ee sdk is totally different from
which described in the book.
Can you give me some suggections?
Thanks a lot.
17 years ago
Hi.
I am a newbie for Java servlets, and I wrote a sample
"Hello world" program.
But then I don't know where to put .class file to make it accessible through the web.
I have the J2EE SDK1.3 beta version, its method of deployment
is different from which described in books.
Please help.
Thanks.
17 years ago
Thank you very much.
I think your solution is the same as mine.
You see: after setVisible(true); then you called getText3().
So the getText3 is not triggered by pushing the OK button.
The OK button only fires the dispose event.
BTW: instead of dispose(), I used only setVisible(false).
Which differences are there? The dialog I need to show
for many times, so I don't need to destroy it.
18 years ago
It is the same event, but it needs to process the data which
user input in the dialog.
I tried:
dialog.setVisible(true);
//get data from dialog then go on.
So I suppose that the dialog is modal, and after setVisible(true), other commands can go on only after user closes the
dialog.
And it works well.
But I am afraid that such a solution is not "pretty".
I wanted to get such an interface like
JOptionPane.showDialog......
18 years ago
I wrote my own customerized dialog--subclassed JDialog.
When the user push the OK button of the dialog,
it should close the dialog and transfer the input data
to the parent frame and fire some event of the parent frame.
But I don't know how can I fire the parent frame's event
in the action listener of the dialog's OK button.
Can you help me with this?
Please show some sample codes.
Thanks a lot.
18 years ago
When a button is pressed, I need some information(like an int)
to be transffered into the "actionPerformed" function,
but I don't know how can I bind some client data with the button or with the event.
Who can help me?
Thank you.
18 years ago
Thank you for your reply.
In fact the contents is obtained from a file, and
I got it in String type.
Can you tell me, how to get a String in Unicode form?
Thanks.
18 years ago
I tried following code:
JTextArea ta=new JTextArea();
ta.setLineWrap(true);
ta.setFont( new Font("MS Song", Font.PLAIN, 14));
ta.setLocale(new Locale("zh", "CN"));
......
ta.setText("something in Chinese @#$%&&%$#@");
What the TextArea showed is unreadable. But if I copy some
Chinese text from another editor and paste it to the TextArea, it can be displayed correctly.
18 years ago
I need to display Chinese characters on TextArea,
but did not succeed. I tried both TextArea and JTextArea.
Please help. what shoud I do?
setFont?
setLocale?
how to change encoding?
The OS is Windows NT4.0 English version.
Thanks.
[This message has been edited by ego hu (edited May 03, 2001).]
18 years ago
Hi.
I've just passed the exam today with 94%.
Now I am thinking about the furthur studying and reading
about Java. Like server page, EJB, XML and etc.
I thought that "Thinking in Java" must be good, but
I learned from the Internet, that it is suitable for beginners.
Can anybody who read this book tell me, is it suitable
for a SCJP?
Can anybody give me some suggestions about the good books?
Thank you.
Yes. The code is numbered. Even the bracket .
You can read the "exam conventions" at the end of RHE.
18 years ago
You can not prepare for this exam just on paper.
You must write some simple programmes to check everything.
And you must read not only the books, but the Java
documentations also.
18 years ago
I've just passed this exam this morning. Good result.
I prepared for it for 2 months, including about 2 weeks
doing something else not related to Java.
The primary book I used is RHE. After reading this book, I planned
to take the exam, then I found this web site and a lot
of mock exams. So I put off my plan for 2-3 weeks to do
the mock exams on this site. And they helped very much.
The usual mock exam score is about 75%-85%. The easiest
is 95%, the hardest is 66%. The sample questions from SUN
I got 100%. Today I was very confident that I would pass it, the
only problem was: how much score!! It turned out: 94%, I made
only 3 mistakes.
There are not too many IO questions as other people said,
and all of them are very easy. The thread questions are
harder. And you must know how to calculate the numbers
on paper to imitate the flow.
The first 10 questions I paid 2 min per question, then I got
relaxed. I finished all the question in 90 min. At the end
I slowed down because I know that the time is plenty. Then
I tried to check again, but I did not change anything, bacause
I trust my first reaction. So I ended that session when there
were 15 min left, because I drank too much water this morning.
The result is better than I expected.
So, good luck, everybody.
Tips: don't drink too much water.

[This message has been edited by ego hu (edited March 30, 2001).]
18 years ago
byte c=(int)16.2;
byte c=(short)16.2;
byte c=(char)16.2;
all of them are valid, why?
It is ~.
Just a typo.