• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Self Reloading applet

 
RyanV
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone I am working on an applet that self reloads whenever it is cancelled. I have the "applet" done but I cannont seem to find a command that will allow me to reload the applet. I also want to be able to specify how many times it reloads before the cancell button actually cancells it. I am very new to java and would like some sample code of a solution if at all possible. If you help I will give you credit on the final project. Thanks!!!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

This sounds really obnoxious. Why do you want angry users? This wouldn't involve advertising, now, would it?

To do this, you'd have to define what you mean by "cancel" (Close a window? Close a HTML page? Press a "Cancel" button?) and also what you mean by "reload" (Disappear and reappear? Refuse to disappear? Simply do nothing? Truly reinitialize?) Once we know what you want to do, we'll be better able to help.
 
RyanV
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is like one of those "are you sure you want to quit" things. I dont want to write a whole new applet for "are you really sure you want to quit?" I would rather just display "are you sure you want to quit?" many times so that even if he closes the html/appletviewer how manynumber of times, he still has recourse. There are people out there that need 2 or more "are you sure you want to quit messages", so I want to modify the number according to the blind impulsivness of the person. That is the point of my applet. To display a vital message more then once so that people wont just click it away.

I would liketo know how to do it on all 3 in case I need a confirmation for something. I would like it to close and then reopen itself. I want it to truely reinitialise.
[ May 06, 2005: Message edited by: Ryan Vergara ]
 
Shyam Prasad Murarka
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Readers,
You can use a for loop that contains the following code:
 
RyanV
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shyam Murarka:
Dear Readers,
You can use a for loop that contains the following code:



can I make it repeat the confirmation dialog more then once? Thanks btw
 
Shyam Prasad Murarka
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya, of course. Just set the values in the for loop properly. The JOptionPane.showMessageDialog() has to be in the for loop.
 
RyanV
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do I have to import anything for JOptionpane to work? Also will the return statement just be {
return confirmation diolauge
}

and if not, what will the reutrn statement lool like?
[ May 11, 2005: Message edited by: Ryan Vergara ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic