File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes question about Event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "question about Event " Watch "question about Event " New topic
Author

question about Event

mark stone
Ranch Hand

Joined: Dec 18, 2001
Posts: 417
i have an event where a user clicks on a Button and on the command line a message or text is printed (System.out.println...)
I am calling the appletviewer and so i can visually see the applet as well as message printed on the command line when user clicks on the Button.
But when i implement it via traditional web server client way then where does this message go and get printed ? is there a way i could put this message printed into a file ? i need some help or rather code that put this message into a file.
basically this is the method that does the printing of the message.
public void actionPerformed(ActionEvent ae)
{System.out.println("Pressed Button");}
so if one of you guys could add code , (i guess this would be the method) that would print this message into a file instead.
rest all the code is fine i need help with this part only. (as i said earlier the reason for this is because it is fine when i use the appletviewer but not when i use a webserver to host this applet. Or can i get this message into a "TextField" on the applet GUI itself. can someone send me a quick snap code for this where this message is written into a TextField or TextArea)
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
But when i implement it via traditional web server client way then where does this message go and get printed ?

This depends on what browser you're using (or maybe you're using the java plugin). On Internet Explorer 5.5 I can view the java console by selecting the last item on the 'View' menu for example.
is there a way i could put this message printed into a file ?

Applets generally can't write to files unless they are given special privileges (imagine the chaos if any java applet could access your hard drive!). You'd have better luck just displaying the text with a java.awt.Label, java.awt.Graphics.drawString(), or Applet.showStatus().
mark stone
Ranch Hand

Joined: Dec 18, 2001
Posts: 417

can u send me snap shot of the code that will put a message to be printed to a TextField in the same Applet ? if its offtopic then send to markstone23@yahoo.com

[This message has been edited by mark stone (edited January 01, 2002).]
mark stone
Ranch Hand

Joined: Dec 18, 2001
Posts: 417
reposting (as i did not get an answer)......
Originally posted by mark stone:

can u send me snap shot of the code that will put a message to be printed to a TextField in the same Applet ? if its offtopic then send to markstone23@yahoo.com
[This message has been edited by mark stone (edited January 01, 2002).]

Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Something like this:

------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question about Event