Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about Event

 
mark stone
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like this:

------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic