B4J Question Noob Java Question

Discussion in 'B4J Questions' started by B_FISH, Mar 21, 2015.

  1. B_FISH

    B_FISH Member Licensed User

    HI

    I'm converting a native Java applet to BASIC 4 Android.

    There are several .java files each one containing a single class definition.

    There is a "main" file plus four additional .java files; each of these 4 is referenced in the "main" .java file by defining a variable and specifying the variable type as one of the 4 class names.

    So far, so good???

    Now, in the "main" file there is a function named "update" defined containing a few dozen lines of code.

    However, I can find NO reference to where that function is called; neither in the "main" file itself, nor any of the other class files (where I wouldn't expect to find it referenced, anyway).

    I KNOW that "update" is being called from somewhere because the applet works correctly.

    I'm going bonkers trying to find the call to "update". Can anyone make a suggestion??

    B_FISH
     
  2. Daestrum

    Daestrum Well-Known Member Licensed User

    I would guess the 'update' routine is called from the browser ie externally to the applet.
     
  3. B_FISH

    B_FISH Member Licensed User

    Not knowing Java (much) I assume you mean the call to "update" is made directly from the HTML page in which the applet is embedded???

    I didn't know that was possible; even so, I checked the html page and found know reference to "update" in there either.

    Thanks anyhow.

    B_FISH
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Is this question related to B4J?
     
  5. warwound

    warwound Expert Licensed User

    Just a guess...

    Does the 'main' class implement an interface and the 'update' method is a callback required by the interface?
    Has the 'update' method been annotated with '@override'?
     
  6. B_FISH

    B_FISH Member Licensed User

    Question is related to B4A. But thought might get more responses in B4J section. Sorry if I posted in wrong area.

    Warwound, I will check your suggestions.
     
  7. B_FISH

    B_FISH Member Licensed User

    Just in case one of you experts wouldn't mind taking a quick look at the source (and maybe spotting my issue), I'm uploading it with this message. The main module is LED.java.

    This was a java applet to embed in a web page and provided an animated (scrolling) signboard, similar to those you see advertising almost anything in stores, shop windows, etc.

    I believe it was created almost 20 years ago by a college student named Darrick Browne.

    I thought converting it to a B4A app would make a great first (learning) project.

    Thanks

    B_FISH
     

    Attached Files:

    • LED.zip
      File size:
      15.8 KB
      Views:
      36
    Last edited: Mar 22, 2015
  8. B_FISH

    B_FISH Member Licensed User

    Warwound..... Main class implements "runable" NO "@override" seen.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice