Solved

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

Posted on 2002-04-01
2
200 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
Comment Utility
use
repaint()
in your init() method.
0
 

Author Comment

by:dom_bus
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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 about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

771 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

11 Experts available now in Live!

Get 1:1 Help Now