Solved

Applet doesn't update until resizing of Frame.

Posted on 1997-05-19
3
271 Views
Last Modified: 2012-05-04
I have an applet consisting of several panels. The bottom panel is a graph area and is added when a button is pushed. The problem is that when I add it, it only draws some of the lines I specified, and the panels aren't properly aligned. When I resize the Frame the applet is showing in, the entire thing is drawn and the panels align themselves. The same is the case if I run it in a browser, i.e. it only works properly AFTER I resize the browser.

I have tried repaint(), update(), and paint() on both the applet and the panels involved, but nothing changes.

Supplying the code is possible but will take a little work since I have to extract it from a larger context, but I'll do it if there is no other way.
0
Comment
Question by:bjoern
[X]
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
3 Comments
 
LVL 6

Expert Comment

by:jpk041897
ID: 1220591
Have you tried repainting the container?
0
 
LVL 3

Accepted Solution

by:
garik earned 100 total points
ID: 1220592
Try to call validate() in the container your panels are in.
Browser resizing generates stop(), resize(), and start() sequence for the applet, and the call to resize() should initiate validates() for all container's layout managers.
If this doesn't help, then I'd like to see your code.
Good luck!

0
 

Author Comment

by:bjoern
ID: 1220593
Hmm, I thought I had tried that earlier, but apparantly I hadn't, coz now it works ;) Thanx
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
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…
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 learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

623 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