Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
more than one jdk and one jre 1 50
Java: anonymous class 4 29
java imports not found 4 25
collection output issue 9 36
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

856 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