problem with java applet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neelesh kumar
    New Member
    • Mar 2007
    • 44

    #1

    problem with java applet

    sir,
    i have an applet .in that some signals are there which are represented by ovals.if any signal fails that oval has to flash(toggle betwwen red and black colors like that).
    problem is along with that oval, some part of the applet is flickering(mino rly)lightly from top to bottom for some time and steady for some time though i wrote the repaint coordinates properly.i want that remaining applet doesnt flicker lightly also.
    why this is happening.i didnt get solution from 4days.i am trying.where is the problem i didnt get.
    please help me
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by neelesh kumar
    sir,
    i have an applet .in that some signals are there which are represented by ovals.if any signal fails that oval has to flash(toggle betwwen red and black colors like that).
    problem is along with that oval, some part of the applet is flickering(mino rly)lightly from top to bottom for some time and steady for some time though i wrote the repaint coordinates properly.i want that remaining applet doesnt flicker lightly also.
    why this is happening.i didnt get solution from 4days.i am trying.where is the problem i didnt get.
    please help me
    Are those signals 'real' signals, i.e.from the physical world? How fast do you
    sample those signals? If you sample them very frequently and you change
    colours very frequently when that sample 'fails' you might not even see your
    oval blinking, i.e. it's blinking too fast to be seen by the human eye.

    kind regards,

    Jos

    Comment

    • neelesh kumar
      New Member
      • Mar 2007
      • 44

      #3
      those are real signals(railway signals).
      with signsls no problem.along with signals, remaining applet also flickering lightly for some time and some time steady.
      in my code flash is thread.
      try{
      flash.sleep(500 );
      }

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by neelesh kumar
        those are real signals(railway signals).
        with signsls no problem.along with signals, remaining applet also flickering lightly for some time and some time steady.
        in my code flash is thread.
        try{
        flash.sleep(500 );
        }
        From the information you supplied it *could* work, I can't tell. I would do it this
        way: your 'Flash; object sleeps an amount of time, creates a certain Oval when
        it wakes up, with a certain colour, position and size and delivers the Oval
        object at a JComponent which collects it in a list. The Flash object invokes the
        repaint method on the JComponent and repeats its sleeping cycle.

        When the JComponents drawComponent method is invoked it simply draws all
        the ovals in the list and removes them. Something along that line ...

        kind regards,

        Jos

        Comment

        Working...