Solved

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

Posted on 2002-04-01
2
229 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

713 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