Solved

why does paint(Graphics g) in my applet not do it's job at startup?

Posted on 2002-04-01
2
211 Views
Last Modified: 2010-03-31
hi,

i'm programing an applet using jdk 1.3 and no swing, but awt classes.

in a panel i use the paint(Graphics g) method to paint some lines etc. to form "tabs" at the top of the applet.

when i first load the applet, these tabs are not being displayed. but when i drag some other window (e.g. other browser window) over the applet and away again the tabs are being painted suddenly.

this happens when using netscape 4.78 & java-plugin 1.3.1

can anyone tell me how i get the applet to paint these tabs straight away at the beginning?!

thanx for your help.

dominik

here's my applet : http://www.getinvolved.unizh.ch/glossar/dev/
0
Comment
Question by:dom_bus
2 Comments
 
LVL 9

Accepted Solution

by:
Venci75 earned 50 total points
ID: 6910202
use
repaint()
in your init() method.
0
 

Author Comment

by:dom_bus
ID: 6910233
hi Venci75,

just adding repaint to the init() method didn't work for my, but that was because i obviousely had to repaint all my panels as well.

so i added  mypanel1.repaint(); mypanel2.repaint(); mypanel3.repaint(); etc. to the init() of my applet. now it works.

thanx a lot for the hint!

dominik
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Running Jira on Raspberry PI 2? 3 267
what is the difference between "sudo su" and "su - root" 6 106
eclipse formatting 6 73
Java Loop 6 50
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now