Applet reset via state wipe

I need to code a restart internally in my applet rather than manipulate the external execution environment to effect the applet restart. For example, I could have a boolean variable to change from false to true at when a reset button method is invoked, and the restart would key on the value of the boolean; and upon restart, the boolean would immediately change to false. My code is time limited, but the duration limit constant is so large( 6000 seconds) that it really shouldn't matter for most cases. However, I might desire a timer thread that wakes up at the appropriate time or on a regularly schedule interval in order to check the stateand reinitiate restart if necessary. This restart would likley consist of wiping the current state and returning to a new state so that another simulation can be run. Otherwise, my code is not time limited below the duration limit. I have a reset button that can have a method coded such that when pressed either intiates the state wipe or wakens a sleeping thread to do the work. It is possible that a thread is ignoring thrown exceptions, but I'll look into that possibility as well. What are some specific suggestions or code examples for this applet code modification?

disregard

Similar Messages

  • HT4798 i created my apple id account, verified but know i m unable to log on, it says incorrect password, i tried to reset via forgot password option but it does not send reset password page to my e- mail address, how can i get this sorted or delete my pr

    User created apple id account, verified but know she is unable to log on, it says incorrect password, she tried to reset via forgot password option but it does not send reset password page to here e- mail address, how can i get this sorted? or how can i get her whole apple account deleted and created new one using same e - mail address?

    The idea to jumpstart by change was not the smartest one, but gives you an opportunity to use that "temporary" account as permanent. You do not have a choice cause obviously despite you thinking that old account is no more -it does exist on Apple servers. And if you are unwilling to share your [email protected] with friend, just create one extra [email protected] for your friend. One suggestion - do not use gmail.

  • I need help reinstalling Adobe Photoshop Elements 12 and Premium Elements 12. I have opaid for these programs however my computer recently needed to be reset via recovery and they were erased, Any help? The link Adobe chat gave me download something-but t

    Help. Need to reinstall Adobe Photoshop Elements 12 and Premier Elements 12. Both are pre paid programs that I had on computer, however the system needed to be reset via recovery and these programs were erased> Since I already forked out the cash for these I'd like to be using them as I am an artist and need the programs. Please, any help? Ideas?

    You should try to keep the title short and sweet and put the details in the message... it's a mystery what happened regarding the download link, so here's some...
    PSE 10, 11, 12 - http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-10-11-downloads.html
    PE 10, 11, 12 - http://helpx.adobe.com/premiere-elements/kb/premiere-elements-10-11-downloads.html

  • Access file applet function via javascript

    hi all
    when i want to have access to the method (which in fact read a file) of my applet class via javascript, a java error is raised: access denied
    BUT i have signed the related jar!
    when i want to access the method (which in fact read a file) of my applet class via the normal way (put a button into a frame and....) it works.
    are there more configurations to do or ....?
    Kind Regard Tom
    here is the code
    HTML file
         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
         <head>
         <link type="text/css" rel="stylesheet" href="/css/style.css">
              <script type="text/javascript">
              function xclick() {
              alert( document.getElementById('applet').isFileOk());
              document.getElementById('fichier').value = document.getElementById('applet').isFileOk();
              //alert(document.portal.applet.isFileOk(path));
              function checkfile() {
                   //var fichiercacher = document.portal.fichier.value;
                   var fichiercacher = document.getElementById("fichier").value;
                   document.getElementById("fichiercacher").value = fichiercacher;
                   document.getElementById("fichiercacher").value = fichiercacher;
                   document.getElementById("chemin").value = fichiercacher;
                   alert("fichier cacher" + fichiercacher);
                   alert("chemin=" + document.getElementById("chemin").value);
              </script>
         </head>
         <body >
         <form name="portal" method="post" action="" >
    <p align="center" id="corps">
         <img border="0" src="ilias.bmp"><br>
         <applet id="applet2" code="NumberOfLine.class" archive="NumberOfLine.jar" width="150" height="109" >
              <param name="maxLines" value="50" />
              <param id="chemin" name="fichierparam" value="" />
              </applet>
              <applet id="applet" code="localfile.class" archive="localfile.jar" width="150" height="109" >
              <param name="maxLines" value="50" />
              <param id="chemin" name="fichierparam" value="" />
              </applet>
         <br>
                   <div id="divloading" ></div>
         <input type="hidden" name="fichiercacher" />
         <input type="file" name="fichier" onchange="checkfile()">
    <input type="button" value="click me" onClick=xclick() ; />
         </p>
         </form>
         </body>
         </html>
    Class NumberOfLine javascript way
    import java.applet.Applet;
    import java.awt.Button;
    import java.awt.Label;
    import java.io.*;
    public class NumberOfLine extends Applet {
    private boolean fileok = false;
    Label message = new Label("MAX line = 40 ");
    Button btnok = new Button("check file");
    int maxline = 40;
    public void init() {
         String sMaxLines = getParameter("maxLines");
         if ( sMaxLines != null ){
                   this.maxline = Integer.parseInt(sMaxLines);
                   System.out.println(this.maxline);
         public String isFileOk(String chemin) {
              File ffile = new File( chemin);
              try{
                   FileReader fr = new FileReader(ffile);
                   LineNumberReader ln = new LineNumberReader(fr);
              int count = 0;
              while (ln.readLine() != null) {
              count++;
              System.out.println("Total line no: " + count);
                   ln.close();
                   fileok = (count <= maxline);
              catch(IOException e){
                   e.printStackTrace();
                   System.out.println(e.toString());
              return fileok ? "ok" : "nok";
    CLass localfile Normal way
    import java.applet.*;
    import java.awt.*;
    import java.util.*;
    import java.lang.*;
    import java.text.*;
    import java.awt.event.*;
    import java.io.*;
    public class localfile extends Applet {
         public localfile() {
              Panel p = new Panel();
              Font f;
              String osname = System.getProperty("os.name","");
              if (!osname.startsWith("Windows")) {
                   f = new Font("Arial",Font.BOLD,10);
              } else {
                   f = new Font("Verdana",Font.BOLD,12);
              p.setFont(f);
              p.add(new Button("Open"));
              p.add(new Button("other"));
              p.setBackground(new Color(255, 255, 255));
         p.setSize(800, 800);
              add(p);
              setSize(800, 800);
              setVisible(true);
         public String isFileOk(){
                   System.out.println("OPEN CLICKED");
                   int arrlen = 10000;
                   byte[] infile = new byte[arrlen];
                   Frame parent = new Frame();
                   FileDialog fd = new FileDialog(parent, "Please choose a file:",
                   FileDialog.LOAD);
                   fd.show();
                   String selectedItem = fd.getFile();
                   if (selectedItem == null) {
                        // no file selected
                   } else {
                        if ((fd.getFile()).endsWith("txt") || (fd.getFile()).endsWith("text")){
                             File ffile = new File( fd.getDirectory() + File.separator +
                             fd.getFile());
                             // read the file
                             System.out.println("reading file " + fd.getDirectory() +
                             File.separator + fd.getFile() );
                             try {
                                  FileInputStream fis = new FileInputStream(ffile);
                                  BufferedInputStream bis = new BufferedInputStream(fis);
                                  DataInputStream dis = new DataInputStream(bis);
                                  try {
                                       int filelength = dis.read(infile);
                                       String filestring = new String(infile, 0,
                                       filelength);
                                       System.out.println("FILE LENGTH=" + filelength);
                                       System.out.println("FILE CONTENT=" + filestring);
                                  } catch(IOException iox) {
                                       System.out.println("File read error...");
                                       iox.printStackTrace();
                             } catch (FileNotFoundException fnf) {
                                  System.out.println("File not found...");
                                  fnf.printStackTrace();
                        } else {System.out.println("Error this is not a txt file"); }
              return "turc";
         public boolean action(Event evt, Object arg) {
              if (arg.equals("Open")) {
                   System.out.println("OPEN CLICKED");
                   int arrlen = 10000;
                   byte[] infile = new byte[arrlen];
                   Frame parent = new Frame();
                   FileDialog fd = new FileDialog(parent, "Please choose a file:",
                   FileDialog.LOAD);
                   fd.show();
                   String selectedItem = fd.getFile();
                   if (selectedItem == null) {
                        // no file selected
                   } else {
                        if ((fd.getFile()).endsWith("txt") || (fd.getFile()).endsWith("text")){
                             File ffile = new File( fd.getDirectory() + File.separator +
                             fd.getFile());
                             // read the file
                             System.out.println("reading file " + fd.getDirectory() +
                             File.separator + fd.getFile() );
                             try {
                                  FileInputStream fis = new FileInputStream(ffile);
                                  BufferedInputStream bis = new BufferedInputStream(fis);
                                  DataInputStream dis = new DataInputStream(bis);
                                  try {
                                       int filelength = dis.read(infile);
                                       String filestring = new String(infile, 0,
                                       filelength);
                                       System.out.println("FILE LENGTH=" + filelength);
                                       System.out.println("FILE CONTENT=" + filestring);
                                  } catch(IOException iox) {
                                       System.out.println("File read error...");
                                       iox.printStackTrace();
                             } catch (FileNotFoundException fnf) {
                                  System.out.println("File not found...");
                                  fnf.printStackTrace();
                        } else {System.out.println("Error this is not a txt file"); }
              } else return false;
              return true;
    }

    Thx you were a great due to my big lak of java skills.
    i found the solutions and for those who are interrested here is the code:
    public String isFileOk(final String filepath){
              System.out.println("OPEN file=" + filepath);
              int arrlen = 10000;
              byte[] infile = new byte[arrlen];
                        try {
                   FileInputStream fis = (FileInputStream) AccessController.doPrivileged(
                   new PrivilegedExceptionAction() {
                   public Object run() throws FileNotFoundException {
                   return new FileInputStream(filepath);
                             BufferedInputStream bis = new BufferedInputStream(fis);
                             DataInputStream dis = new DataInputStream(bis);
                             try {
                                  int filelength = dis.read(infile);
                                  String filestring = new String(infile, 0,
                                  filelength);
                                  System.out.println("FILE LENGTH=" + filelength);
                                  System.out.println("FILE CONTENT=" + filestring);
                             } catch(IOException iox) {
                                  System.out.println("File read error...");
                                  iox.printStackTrace();
                             } finally {
                                  try {
                                       fis.close();
                                  } catch(IOException ioe) {
                                       //oops
                   } catch (PrivilegedActionException e) {
                   // e.getException() should be an instance of FileNotFoundException,
                   // as only "checked" exceptions will be "wrapped" in a
                   // PrivilegedActionException.
                   //throw (FileNotFoundException) e.getException();
                        e.printStackTrace();
                        return "nok";
                   return "ok";
         }

  • OWA Password reset via UPN

    I need to know if Exchange 2013 SP1 (15.0.847.32) supports password resets via the users UPN when a user's password has expired when they log in to OWA.  This was a feature that was added to Exchange 2010 SP1 in rollup 3 (http://support.microsoft.com/kb/2464564).
    I'm able to login to OWA with their UPN but upon being presented with the password reset screen the user has to use DOMAIN\Username rather than their UPN (email address).
    Without this feature I can't see how hosting providers can simplify the users experience when they are resetting their passwords.  I would prefer not for the user to have to remember their AD logon name, I just want my users to have to remember their
    email address.

    Hi,
    Based on my knowledge, Exchange 2013 doesn't support using a UPN in the change password dialog so far. I recommend you use the format domain\username after allowing users to change their expired passwords. Thanks for your understanding.
    Hope this can be helpful to you.
    Best regards,
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Amy Wang
    TechNet Community Support

  • My iphone 6 is disabled because of incorrect passcode but my apple account isn't activated yet so I cannot reset via itunes

    My iphone 6 is disabled because of incorrect passcode and i cannot reset via itunes because i have not yet activated my apple account.

    +Do a DFU recovery:+
    +1. Open iTunes.+
    +2. Connect the iPhone+
    +3 Press both the home and sleep/wake buttons until the Apple icon appears (ignore the red slider if it shows).+
    +4. Continue pressing the home button alone until iTunes sees your phone in recovery mode.+
    +5. Follow the prompts to restore the iPhone.+
    If not, take it down to mobile dealers that can reset your phone for you. All data will be lost.

  • When I want to play music out loud the volume bar disappears and it won't play music or any sound. This sometimes happens with head phones in aswell. How do I fix it? I have tried to reset settings and wipe all the data of it but it didn't work.help!

    When I want to play music out loud the volume bar disappears and it won't play music or any sound. This sometimes happens with head phones in aswell. How do I fix it? I have tried to reset settings and wipe all the data of it but it didn't work.help!     

    Although you say you have let the battery drain, was it for long enough? Since nothing else that you've tried so far has worked, I suggest that you leave the iPod unplugged for at least four days, preferably a week. That way, if something is stopping the iPod from turning the screen on, then whatever it is will drain the battrey. However, since the screen isn't on, that may take longer than if the screen was on.
    Then, after that time, plug the iPod into a power source and leave it alone for at least thirty minutes. Only after thirty minutes will it show any signs of life, but you should leave it until it is fully charged before trying to use it.
    If you get to this stage, the fact that the battery has drained will cause the iPod to reset when it springs back to life.
    Let us know how you get on.

  • Reset portal state

    We are securing our portal Books and Pages using ALES ( AqauLogic Enterprise Security)
    When the user goes to the portal, they see only the login page and after the user is logged in, rest of the books and pages show up based on the user permissions
    Our login is a pageflow controller and I am explicitly redirecting to the portal again.
    Still, I do not see any books and pages after the user logs in. I have to explicitly hit the refresh button on the browser to see the books and pages
    Do I have to reset anything?
    Thank You

    <p>The jist of my issue is that I need to reset several books through out my portal to have their default page as active (preferably by resetting their state entirely, as opposed to specifically setting the default page to be active).
    </p>
    <p>
    I was not aware of _nfls=false
    </p>
    <p>
    I searched support for info on it and found your post from 8/20/2003... If I put this in a request, will it wack the state of a control that is not in the optimized tree for that request?
    </p>
    -John

  • Browser User Assist History - Reset/Clear/Delete/Wipe - Help

    Hello,
    I'm trying to find out how to somehow Reset/Clear/Delete/Wipe the user assisted browser history when I'm typing a website on a iPhone or iPad. I have tried on both devices iOS 6.0.1( 10A525 ) on both by going to Settings -> Safari -> (Clear History + Clear Cookies and Data) and the browser history is still there.
    Is there any other settings that may Reset/Clear/Delete/Wipe the user assisted browser history?
    Thank you.

    Hi Shobit,
    Check this link:
    Cookies Problem with 3 tiered SSO
    Thanks and Regards,
    Shyam.

  • HT1430 does resetting your iphone wipe out everything on your phone?

    Does resetting your iphone wipe out everything on your phone? My phone shut off tonight and I can't even restart it - it's locked in the off mode.

    A reset should help. Tap and hold the Home button and the On/Off buttons for approximately 10-15 seconds, until the Apple logo reappears. When the logo appears, release both buttons.
    No content is affected by this procedure.

  • Reset portlet state

    Hi,
    I use JSR-168 portlets and Spring PortletMVC and I need "reset" button in menu.
    It's possible to reset/clear the state (render parameters, portlet modes etc. ) of all portlets on portal when a user clicks on a page-link in the menu navigation?
    thx a lot.

    Hello,
    Using strictly the JSR168 API, I don't believe there is a way to reset the state of all portlets on a portal when a user clicks any single link. With the JSR286 API you could do this with events, but WLP does not support JSR286 yet (though the next release will have full support!).
    WLP does support events in JSR168 portlets, so you could use that in the meantime; simply have the link trigger an event that all the portlets on your portal listen to, and in their event handler methods have them reset their render parameters and state to whatever defaults you want.
    Kevin

  • Windows 8 Reset fails to wipe drive

    Hello, First off the ultimate issue right now (then the history).  And sorry for the length but I wanted to be as detailed as possible.
    Last night I did a full Windows Reset on a Windows 8.0 installation. I did this because of issues I was having and the possibility of a virus.  This version of the Reset is suppose to take several hours and reformat the drive so that it is completely
    clean (in case you give the laptop away or just want to start from scratch - I just wanted to start over).  BUT when I start it up there are still data / files from my old install.  My Internet Explorer Favorites still exist on the C drive AND all
    my saved passwords are still listed when I look at the Web Credentials.  So the Reset failed, at least to some extent.  NOTE - I only ran the Reset on the C drive as that is where Windows is installed.  My Data, Music and Program Install files
    are on separate partitions.
    The History:  I was starting to have issues with Windows 8.1.  It was slow when browsing and I kept getting multiple errors such as:
    - "Your computer was not assigned an address from the network (by the DHCP Server) for the Network Card with network address",
    - Various DCOM errors
    and
    - Constant / Multiple errors where "The [xxx] service terminated unexpectedly...  ".  These errors involved many different services and included service host, crypto (something), DCOM, windows live, networking...
    countless.  The event ID's were generally in the 7021 - 7050 range. 
    The final straw was when the laptop (an ASUS S550C) would randomly shut off or terminate exporer.exe so I had a blank screen.  I had already run a full scan with Malwarebytes and Panda without any notifications. 
    So I initially did a Refresh.  I ran windows update and installed all the updates (with some problems but overcame them) and upgraded to 8.1.  It didn't help.  Same constant errors.  So I decided to do the
    basic Reset. 
    After the Reset I updated Windows but did NOT upgrade to 8.1.  I only installed Logitech Setpoint and Office 2010.  ALSO what was odd to me is that some data / files that were on my previous installation (like Internet Explorer
    Favorites and History) were still present as were all my saved passwords.  Also still tons of errors, mostly DCOM, DHCP not assigning address and MULTIPLE "The [xxx] service terminated unexpectedly... ".  A google search mentioned
    a possible virus with these errors.
    So I uninstalled my installed programs and last night ran the complete Windows Reset (the one that is suppose to take several hours and completely wipe the drive so you can get rid of the computer or do a complete start from scratch.  I haven't
    done any updates or installs.  BUT guess what.. my IE favorites are still present on the C drive AND all my saved passwords still exist under credentials.  So the Reset (which is suppose to reformat the drive) obviously didn't work.  There were
    a few errors during the Reset but appear to have been near the end including: 
    - Error - "Crash dump initialization failed!"  [Source = volmgr; event ID = 6]
     - Warning - "Profile notification of event Delete for component {DE3F3560-3032-41B4-B6CF-F703B1B95640} failed, error code is ???"  [Source = User Profile Service; event ID = 1534]
     - Warning - "Profile notification of event Delete for component {D63AA156-D534-4BAC-9BF1-55359CF5EC30} failed, error code is The system cannot find the path specified"  [Source = User Profile Service; event ID = 1534]
    - Warning - "The maximum file size for session "ReadyBoot" has been reached. As a result, events might be lost (not logged) to file "C:\WINDOWS\Prefetch\ReadyBoot\ReadyBoot.etl". The maximum files size is currently
    set to 20971520 bytes"   [Source = Kernel-EventTracing; event ID = 4]
    - Error - "Session "ReadyBoot" stopped due to the following error: 0xC0000188  [Source = Kernel-EventTracing; event ID = 3]
    The good news is I'm not getting the "service terminated" errors.  Mainly just the DHCP not assigning an address errors.
    ANY IDEAS? Before starting to update and install everything again I would like to know it's safe to do so.  I'm concerned because if there was a virus and the Reset didn't actually wipe the drive then it may still exist.  And
    why wouldn't the Rest work?

    Hi,
    First I have a question: Did you redirect any folder under your user profile to another location?
    Regarding current information, the event about Readyboot will not affact your operation of this computer.
    ReadyBoot is used by the ReadyBoost service that optimizes the boot time of your computer to a minimum.
    Kate Li
    TechNet Community Support

  • Connect to applet method via JS

    hi,
    i have two frames in my web page. One with my tree applet in it, and the other to display some pdfs. What i want to have is when to user clicks on a pdf button, i want to pass some information back to my applet via javascript. I am using Acrobat writer which allows me to use javascript. The code is use to send the information
    onClick=SimpleTree.Rupz(Introduction.pdf);
    Rupz is a public method in my applet that needs a string
    I embed my applet in the html using
    <APPLET code="SimpleTree.class" name ="SimpleTree" width="150" height="400"></APPLET>
    However when i do this i get the error
    ReferenceError: SimpleTree is not defined
    Could someone please tell me what is goign wrong?
    Thanks
    Rupesh
    [email protected]

    See chapters 25 and 25
    http://java.sun.com/j2se/1.4/docs/guide/plugin/developer_guide/contents.html#contents

  • I have an iPad 2 screen has gone blank, I've reset via iTunes now screen is still blank but flashes white and you can see the hello, hallo in all different languages, but can't access anything???I

    I Have an iPad 2 the screen has gone blank, I have held both home and off button but nothing working the screens still blank. I have also reset my iPad via iTunes but now the screen is blank but it's flashes white and you can vaguely see hello, hallo in all different languages. Can anyone please help?

    Is it fully charged?
    The computer usb port will not charge it.  Plug it into an outlet with the charger that came with it for a few hours & try again.

  • Reset the state of one switch when another switch is pressed in a VI

    I have a START/STOP latching button and a PAUSE/RUN latching button. I would like to be able to reset the PAUSE button when the START/STOP button is pressed. Sometimes the user leaves the PAUSE button latched and then presses the START/STOP button. This then activates only part of the VI.

    You could do this in eoither of two ways. The most straight-forward is the case where you have a state-machine of some sort handling the button presses. All you would have to do is insert a local variable of the Pause/Run button in the case structure that is executed when the Start/Stop button is set to the "Stop" position. The local variable would allow you to force the switch into whatever state you want.
    The other possibility is that you might want to do it in a subvi. In that situation you'd need to pass to the subvi a reference to the Pause/Run button and use the "Value" property to turn it off. The disadvantage of this approach is that according to NI using property nodes to set the value of a control is much slower than writing to it directly with a lo
    cal variable.
    If you have specific questions feel free to follow-up. Also if you could post the pertinent bits of the code in 6.0 format I could give you very specific recommendations.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Error trying to run sample jsf_cardemo

    Hi all, I tried to run jsf sample jsf-cardemo on oc4j 9.0.3 I deployed the war file jsf-cardemo.war which comes bundle with jsf1.1 release The same app is running perfectly on tomcat 4.1.29 But it gives me the following error in oc4j9.0.3 java.lang.I

  • Adjustment required due to modification.

    Hi, We are using Travel Management ERP6.0. SAP provides a screen 9999 (User Data screen) within the dialog program SAPMP56T for customers to store or display custom fields, but this is still considered a modification. We did utilize heavily on this U

  • Can you see the problem?

    i'm trying to write a simple image viewer application. Can you see the problem. i can't. i'll appreciate any advice or help? import java.awt.*; import java.awt.image.*; import java.awt.event.*; import java.io.*; public class SimpleViewer extends Fram

  • Why does firefox go crazy when I try to email from a website?

    When I want to contact, say, customer service of a company and I use their email "form" on their website Firefox goes insane and opens 100 plus tabs and blinks, going so fast that I can't possibly shut down all of the tabs because it's making more th

  • Best Partition for Time Series

    Hi All, i have the following tables in my DB CREATE TABLE READING_DWR ( ID     VARCHAR(20)     NOT NULL, MACHINE_ID     VARCHAR(20), DATE_ID     NUMBER, TIME_ID NUMBER, READING NUMBER CREATE TABLE DATE_DIMENSION ( DATE_ID     NUMBER     NOT NULL, DAT