Solved

Applet doesn't update until resizing of Frame.

Posted on 1997-05-19
3
266 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java array passed to SQL where clause 23 60
Java / Linux and Regular Expressions 11 67
session migration servlets 2 23
MySqlDump not dumping triggers 1 12
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 will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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…

948 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

22 Experts available now in Live!

Get 1:1 Help Now