Painting to the applet.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Painting to the applet.

  1. #1
    Adeline Rose Guest

    Painting to the applet.


    Respected Sir/Madam,
    I'm reading a file line by line. I want the contents of the file
    to be displayed line by line on the applet. So after reading a line from
    file I call repaint to paint the string to the applet. But when I write a
    new string it erases the previous, and finally only the last line is visible
    on the applet.
    How can this problem be solved?

    With regards,


    Adeline Rose

  2. #2
    Tom Duffy Guest

    Re: Painting to the applet.


    Hello Adeline:

    Where are you painting the String? If the coordinates you pass are the same
    each time you repaint, then the VM will first clear the screen and then paint
    the new String. It sounds like you'll need to change the coordinates (well,
    at least the y-coordinate) each time and override update() so that the applet
    doesn't clear the screen each time something is painted.

    HTH,

    Tom Duffy

    "Adeline Rose" <adelinerose@usa.net> wrote:
    >
    >Respected Sir/Madam,
    > I'm reading a file line by line. I want the contents of the

    file
    >to be displayed line by line on the applet. So after reading a line from
    >file I call repaint to paint the string to the applet. But when I write

    a
    >new string it erases the previous, and finally only the last line is visible
    >on the applet.
    > How can this problem be solved?
    >
    >With regards,
    >
    >
    >Adeline Rose



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center