Access variables within a timer

How can I access variables within a timer?
I mean variables, that I can use in another class that extends applet i.e.?

The Code can be compiled now with the Java Compiler.
But the image won't move on the screen.
import java.applet.*;
import java.awt.*;
import java.util.*;
public class ChangingApplet extends Applet {
  private Image EricsBild;
  private int x,y;
  private TimerTask update;
  public void start() {
  EricsBild = getImage(getCodeBase(), "heuschrecke.gif");
  x=5;y=5;
    update = new TimerTask() {
      public void run() {
        if (x<300) x++;
        if (y<200) y++;
        if (x>3) x--;
        if (y>2) y--;
        repaint();
    Timer t = new Timer(false);
    t.schedule(update, 1000, 1000);
  public void stop() {
    update.cancel();
  public void paint(Graphics g) {
    g.drawImage(EricsBild,x,y,this);
}

Similar Messages

  • Accessing a javascript variable within a EL, does anyone ....

    know how to do this.
    I have a variable, say eventid, defined as:
    <SCRIPT>
    var eventid = "GA20045533";
    </SCRIPT>
    and a button defined as:
    <hx:commandExButton >
       <f:param id="param_eventID" name="eventID" value = "#{window.eventid}" ></f:param>
    </hx:commandExButton>but this somehow fails. How can I access this variable within the EL for the param tag??

    if you want to access the variable in the same page at the same time?
    you can't
    if you want to access the variable in other page? wich is called from the form? then you just call the parameter request.getParameter("province")
    the value must be the same that the selected index, otherwise use a hidden input for store the selectedIndex

  • How to insert, as an input variable within formula, the total time window on scope?

    How to insert, as an input variable within formula, the total time window on scope (i.e. 20ms/div x 10 div = 200ms)?
    BELOW IS AN EXAMPLE OF ISSUE:
    FORMULA FOR ACTION INTEGRAL:
    STATISTICS:
    Input variable: DPO4034(CH1);
    Check Box: number of samples.
    FORMULA
    Input variable 0: DPO4034(CH1); alias: x0
    Input variable 1: "Total Time Window on Scope???"; alias: x1
    Input variable 2: Number of Samples (CH1); alias: x2
    Under Operation Setup: Formula
    Y= (x0^2)*(x1/x2)
    Output: Processed Data 1 (CH1)
    THEN USING STATISTICS:
    Input signal: Processed Data 1 (CH1)
    Check Box: SUM
    Output: CH1 Action Integral [A^2s]
    Solved!
    Go to Solution.

    Hi again Catherine,
    I have now added another TekScope (TDS3032B) along with the DPO4034 and run the same work-around on the TDS3032B using CH1 as the "real" signal channel and CH2 as the "burst width" channel. However, the value returned for CH2 is nominally 99E+36 (min 99E+36, max 99E+36) with very few retrievals of correct burst width (~200ms). Seems the SignalExpress program is unable to consistently retrieve from TDS3032B the actual burst width (scope's time scale/window) and defaults to 99E+36 value. Any ideas on what is occurring and how to make it work? Attached are some screen captures to help guide discussion.
    Regards,
    Michael
    Attachments:
    TDS3032B - incorrect burst width.png ‏301 KB
    TDS3032B - correct burst width.png ‏287 KB
    DPO4034 - always correct burst width.png ‏302 KB

  • Catch-22: need to assign a local variable within an anonymous class

    static boolean showMessage(Window parent, String button0, String button1)
        throws HeadlessException {
              final Window w = new Window(parent);
              Panel p = new Panel(new GridBagLayout());
              final Button b[] = new Button[]{new Button(button0), (button1 != null) ? new Button(button1) : (Button)null};
              boolean rval[]; //tristate: null, true, false
              w.setSize(100, 50);
              w.setVisible(true);
              //add b[0
              gbc.fill = GridBagConstraints.HORIZONTAL;
              gbc.gridx = 0;
              gbc.gridy = 3;
              p.add(b[0], gbc);
              //add b[1]
              if (button1 != null) {
                   gbc.fill = GridBagConstraints.HORIZONTAL;
                   gbc.gridx = 1;
                   gbc.gridy = 3;
                   p.add(b[1], gbc);
              w.add(p);
              w.pack();
            w.setVisible(true);
            //actionListener for button 0
              b[0].addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                             if (e.getSource() == b[0]) {
                                  w.setVisible(false);
                                  rval = new boolean[1];
                                  rval[0] = true;
              //actionListener for button 1
              if (button1 != null) {
                   b[1].addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent e) {
                                  if (e.getSource() == b[1]) {
                                       w.setVisible(false);
                                       rval = new boolean[1];
                                       rval[0] = false;
            while (true) {
                 try {
                      if (rval[0] == true || rval[0] == false) //should trigger NullPointerException
                           return rval[0];
                 } catch (NullPointerException e) { }
         }catch-22 is at
    rval = new boolean[1];
    rval = false;javac whines: "local variable rval is accessed from within inner class; needs to be declared final"
    How do I assign to rval if it's declared final?
    Or at the very least, how do I get rid of this error (by all means, hack fixes are okay; this is not C/C++, I don't have to use sanity checks)?
    I'm trying to make a messagebox in java without using JOptionPane and I'm trying to encapsulate it in one method.
    And I'm far too lazy to make a JNI wrapper for GTK.

    dcminter wrote:
    How do I assign to rval if it's declared final?You don't and you can't. You're not allowed to assign to the local variable of the outer class for extremely good reasons, so forget about trying.
    Or at the very least, how do I get rid of this errorIf you don't want the side effect, then just use an inner class variable or a local variable.
    If you want the side effect then use a named class and provide it with a getter and setter.
    Finally, in this specific case because you're using an array object reference, you could probably just initialise the array object in the outer class. I.e.
    // Outer class
    final boolean[] rval = new boolean[1];
    // Anonymous Inner class
    rval[0] = true; // No need to intialize the array.
    I declared it as an array so that it would be a tristate boolean (null, true, false) such that accessing it before initialization from the actionPerformed would trigger a NullPointerException.
    Flowchart:
    is button pressed? <-> no
    |
    V
    Yes->set and return
    Is there a way to accomplish this without creating a tribool class?

  • Using variables within the definition of ExcelWorkbook in the Data Services 4.2

    Hi Together
    We have installed the Datas Services 4.2 with a matching SAP BO 4.1 Installation
    The Repositories are hosted on a MS SQL Server 2012R2.
    The System is a Windows 2012 R2 Server
    Within a Repository I try to define an ExcelWorkbook.
    Within this Definition I need a
    Format name,
    the Directory where the Excelfile is in the File System,
    the name from the ExcelFile.
    To define the Access method I will use the Namend Range.
    Is it possible to use for the Namend Range a defined variable with a namend Range.
    I’ve tried a lot notations, but I am not able to use that Variable.
    What is a possible Solution ?
    Regards
    Ralph

    Hello Friend,
    You indicate to go to the Central Management Console (http://server/BOE/CMC), click the Data Services option.
    Select the Configure a new Data Services Repository, complete all fields and click Test Connection. If everything is ok and return success message, click save.
    The repository created will appear in your repositories list, then right click it and select the User Security option. Make sure that the Data Services Administrator Users group is present and with Full Control access. To ensure that your user has access, you can also add it through the Add Principals option. Select the desired user, pass to the other side and click the Add option and Assign Security and include Full Control permission and apply.
    In version 4.2 the ability to create access groups within the Central Repository was added.
    To create and manage such groups need access SAP Data Services Management Console:
    http://server/DataServices/launch/launch.do
    Once you have successfully logged on, click the Administrator button.
    On the left side there are some options, espanda the Central Repositories option and if you have properly created the Central Repository it will appear in the list.
    Click User and Groups note that by default comes a set created (digroup), select the User tab and click the option later add.
    Then enter the information which user, group, status and description and apply the changes.
    Made these procedures you can enable your central repository through the DS Designer and create new groups.
    Hope this helps.
    Hugs

  • How do I manipulate process variables within sql?

    Hi,
    I am working with Oracle 10gR2.
    my main problem is to indicate a problem within the execution of a SQLPLUS.
    I saw in this forum that there is a bug and the return code will be ignored.
    So it was suggested:
    As a workaround you can define processflow variable and bind RESULT_CODE parameter of Sql*plus activity to this variable. Then you can define transition from
    sqlplus activity with custom ("complex") condition (like PF_VAR_RC=2 etc.).What exactly shall this mean?
    I am now on the way to solve this by manipulating the process variable within SQLPLUS. But how can I access this variable and manipulate it within PLSQL?
    Many thanks
    cheers Daniel

    Hi Daniel,
    even with this "bug" it is possible to get result of execution SQL*Plus activity:
    - SQL*Plus command exit 0 produce SUCCESS return code in SQL*Plus activity
    - SQL*Plus command exit 1 (or with other non zero value) produce FAILURE return code in SQL*Plus activity
    Regards,
    Oleg

  • HOWTO: Declare a variable within a function.

    I'm having a hard time declaring a variable within a function. This is my code:
    CREATE OR REPLACE FUNCTION schemaName.functionName (inParam VARCHAR2(20))
    RETURN VARCHAR2 IS VARCHAR2(10)
    BEGIN
    DECLARE paramLength NUMBER; --This is not working. The docs do not state what the size of the number returned by LENGTH is.
    SELECT LENGTH(inParam) INTO paramLength FROM DUAL;
    IF paramLength < 10 THEN
    RETURN '';
    ELSE
    /* Clean up the value */
    RETURN inParam
    END IF;
    END;

    In relation to your own code...
    CREATE OR REPLACE FUNCTION schemaName.functionName (inParam VARCHAR2(20)) RETURN VARCHAR2 IS
    paramLength NUMBER;
    BEGIN
      /* Clean up the value */
      paramLength = LENGTH(inParam);
      IF paramLength < 10 THEN
        RETURN NULL;
      ELSE
        RETURN inParam
      END IF;
    END; You don't need to use SQL to determine the length of a string.

  • How can I get my time machine to allow me to recover files again? After upgrading to OS X, the time machine still backs up the files; but, I'm not able to navigate within the time machine or select any folders or files for restore.

    How can I get my time machine to allow me to recover files again?
    After upgrading MBA to OS X, the time machine still backs up the files; but, I'm not able to navigate within the time machine or select any folders or files for restore.
    I've searched and can not find a solution to the problem that's being encountered.

    Yeap that all makes sense now.
    Do you only have the current backup showing in the TM display?? Won't it fill in the rest?
    Over wireless are you waiting for the indexing to finish.. ??
    Previous backup may not show for a couple of hours.
    Long short of it.. Mavericks version of TM is a pain.
    Sometimes it is easier to completely ignore the TM backup and do the restore manually.
    I have posted the details here. See if this helps.
    Can't access old files on time capsule

  • Access Violation within a Single Role Report displays duplicate data

    The output of the 'Access Violation within a Single Role' report under Incident Reports in GRC includes some rows which repeat with identical data.
    I created a test responsibility with conflicting controls in Oracle r12 instance to find out whether it gets reflectedwhen i run the report. But i didnt find the responsibility.
    Is it a set-up error or is there a logic behind this occurance? Please provide inputs.
    Edited by: 963133 on Oct 4, 2012 5:25 AM

    I believe the conflicts shown would show up as many times as there are violations. So if a particular control had 2 entitlements and those had several access points, I would think a violation would show for each access point. Can you confirm this?
    Also do you have the latest AACG? This will help verify that you have the latest with bug fixes.

  • How to read a variable within a VC code.  I am using BADI based VC code.

    How to read a variable within a VC code.  I am using BADI based VC code.
    Lets say I have a variable for a fiscal period that holds cumulative month.
    If user enters 03/2014 in that variable, it will have month starting from Jan till March.
    Within VC code I would like to read the last month which is
    03/2014 and based on this month I would like to do some calculation on all the records using the last month.
    Since VC code runs for one record at a time and there is no way I can store this value.
    Is there a way to go about it....any suggestions would be of great help.
    Thanks.

    Any suggestions would be highly appreciated.
    Thanks!

  • Access traceability within PeopleSoft

    Hi all,
    I'm looking for a little user information regarding how traceable access is within PeopleSoft, particularly concerning how much information can be obtained from PeopleSoft to monitor access to personal data. i.e. is it possible to review any sort of access logs that record what PC has accessed an individuals personal records and how detailed can this information be, for example would it only tell you that a persons record has been accessed or would it also trace what specific data has been accessed, i.e. dependants, remuneration, emergency contacts etc.
    I'm trying to get a feel for how easy / reliable it is to gain information that could aid an investigation into potential security breaches.
    Many thanks for any help you can provide.
    SF

    There's a handy table called PSACCESSLOG which records the login IP address, login and logout time of a particular operator ID. If you need to trace down what a user "did" during a PeopleSoft session, then your application server log files (e.g. APPSRV_1234.log) are a good to place to log. This is all delivered and a good place to start. It won't tell you everything though. If you have specific scenarios that you want to capture, you'll need to write your own auditing. E.g log whenever a person views a specific page.
    You might want to take a look at implementing trigger based auditing for changes to user profiles & security as this is lacking in PeopleTools:
    http://www.peoplesoftwiki.com/auditing-user-profiles (this is for Oracle).

  • Access to a external time capsule through my home time capsule

    How can I access my parents timecapsule through my own at home?
    I have no problems in accessing my own time capsule through for example the network at work (using Automator - and a quite old apple Airport/router).
    But if I'm at home, and on the home network established through my own time cap, I can't get access to i.e. my parents time cap - again using Automator.
    Also I can't get access to my own time capsule through my parents time capsule...
    WHY????
    ...and what can I do?
    The answer I get is:
    The server may not be available or is not available right now. Check the server name or IP address, check your network connection, and then try again.

    If this is still actual:
    The easiest and cheapest you can do is to connect your Macbook to your amplifier. There are several options for that. If your Macbook has optical out (in the headphone/line-out connector), use that for best quality. Otherwise, use a USB DAC or a Griffin iMic. Alternatively, get a DisplayPort to HDMI converter, and use one of your amplifiers HDMI inputs (in that case all you need is a nice external display or a projector and you have yourself the beginning of a home cinema).

  • How do I use a variable within a sql statement

    I am trying to use a local variable within an open SQL step but I keep getting an error.
    My sql command looks like this "SELECT BoardDetailID FROM BoardDetails WHERE SerialNumber = " +  locals.CurrentSerialNo
    If I replace the locals.CurrentSerialNo with an actual value such as below the statement works fine.
    "SELECT BoardDetailID FROM BoardDetails WHERE SerialNumber = " +  " 'ABC001' " 
    Can someone tell me how to correctly format the statement to use a variable?

    Hi,
    Thanks for the reply. I have changed the required variable to a string, but with no success. I have reattached my updated sequence file and an image of the error.
    When looking at the Data operation step I see that the sql statement is missing everything after the last quotation mark.
    Thanks again,
    Stuart
    Attachments:
    Database Test Sequence.seq ‏10 KB
    TestStand error.JPG ‏37 KB

  • How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    The Guest Network function of the Time Capsule and AirPort Extreme cannot be enabled when the device is in Bridge Mode. Unfortunately, with another router...the Telus...upstream on your network, Bridge Mode is indicated as the correct setting for all other routers on the network.
    If you can replace the Telus gateway with a simple modem (that performs no routing functions), you should be able to configure either the Time Capsule or the AirPort Extreme....whichever is connected to the modem....to provide a Guest Network.

  • How to access variables outside user exit

    Hi,
    I'm working with a user exit and my problem is that in a particular moment I have to access variables located outside the scope of the user exit (they are in a standard program)
    How can I reach these variables?
    thanks in advance

    Hi,
    If they are global variables then you can access them using Global assign technique,
    For example,
    FIELD-SYMBOLS: <fs_value> TYPE ANY.
    ASSIGN ('(SAPMV45A)XVBAK') TO <fs_value>.
    It is basically,
    ASSIGN ('(<Std. Program Name>)<Variable name>') TO <field symbol>.
    NOTE: To make sure they are accessible in your user exit, just put a break-point in the user exit and once you are there in debugging, type in,
    (<Std. Program Name>)<Variable name> in the Field names section and if it does not show it in RED then it is accessible..
    Hope this helps.. 
    Sri
    Message was edited by: Srikanth Pinnamaneni

Maybe you are looking for

  • Data Integration in SAP B1 8.8

    Hi All, I got new inquiry for SAP B1 8.8. The lead have requirement as follows: " Our lead have ther own developed erp systems. So their requirement is that they are going make or record all sales transaction in their own erp. at end of the day all s

  • Error -50 problem with deleted playlists

    My son has deleted a playlist named 'on the go' and possibly some others in itunes from the pc hard drive by right clicking and deleting. Now the ipod will not sync and gives error -50 or says 'cannot read or write to drive' Have uninstalled and rein

  • Ibook 12' inch dead

    In the end of August my ibook went dead. When i turned it off, the screen is black and i can hear only my hard drive and the dvd drive which has a cd-rom inside which i can not eject. I have tried to eject the cd whith every option Apple's website su

  • Business rules and CalcScripts in Planning

    Hi Friends In Planning if we go to Tools-> Business Rules, we can see all the calc scripts and Business rules associated with the available plan types.Is there any way we can limit to see only business rules not the calc scripts.some of our Finance u

  • Adjust aliasing of webfonts within an HTML component?

    Hello, I'm trying to use an icon font in an html page that is being loded into an HTML component. I read somewhere that the HTML component uses webkit as its rendering engine, but -webkit-font-smoothing in the web page's css appears to be ignored. Is