Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Applet doesn't update until resizing of Frame.

Posted on 1997-05-19
3
Medium Priority
?
273 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
3 Comments
 
LVL 6

Expert Comment

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

Accepted Solution

by:
garik earned 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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…
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…
Suggested Courses

971 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