This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Self Reloading applet

 
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!!!
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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 ]
 
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 ]
 
ice is for people that are not already cool. Chill with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic