A master invisible applet controls which applet to load and display based on user input. The active applet paints some graphic components onto the background then load whichever child applet as necessary to paint additional components on top of what's already painted there and so on.
I am basically simulating a dialog here. Where the original active applet paints the standard buttons and wallpapers and the child applet paint the drop down and text fields as specific to each dialog. I found that the layout manager in the child applet stops working when used in this manner. Also, note that I have already tried to extend the child as Frames and Panels instead of applets. The results are the same. The parent applet inherits from a chain of abstract classes, I wonder if anything done there can cause this behaviour. Sincrely Yours Patrick -----Original Message----- From: James Stauffer [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 10:14 AM To: jdjlist Subject: [jdjlist] RE: AWT components' platform dependency How do you run an applet on top of another applet? (URL is fine.) James Amos Nathaniel Stauffer -----Original Message----- From: Patrick Li [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 9:02 AM To: jdjlist Subject: [jdjlist] RE: AWT components' platform dependency We don't want to use dialogs for reason of security. We restrict everything to run inside the browser and only the browser. There are many layers of applets on top of each other. -----Original Message----- From: Me [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 1:20 AM To: jdjlist Subject: [jdjlist] RE: AWT components' platform dependency Why run one applet on another? If you need a dialog just use the Dialog class. You'll need a Frame, but it can be just new Frame( ); on 2/12/03 2:55 PM, Patrick Li at [EMAIL PROTECTED] wrote: > Hi, > > Sorry about the typos. The syntax for add() method seems to work both > ways. I also used setLocation() with setSize() for the boundary which I > didn't show in the snipet. The color is for test purposes only. If I run > this simple program below, it works. However, as soon as I put it into > my project, it stops working. I think I have to broaden the context a > little. This applet is painted on top of another applet which holds some > other common graphical components for a set of dialogs. > > I will try to create a snipet of container applet now for further > testing. > > Patrick > -----Original Message----- > From: Me [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 12, 2003 4:25 PM > To: jdjlist > Subject: [jdjlist] RE: AWT components' platform dependency > > > Well I copied your code into my compiler and fixed the errors (mostly > due to > reducing it to a sample I expect. There were a lot of extraneous }'s) > > I fixed the add as I mentioned in the previous email and the setBounds > ending up with > > import java.awt.BorderLayout; > import java.awt.Color; > import java.awt.FlowLayout; > import java.awt.Label; > import java.awt.Panel; > > public class testli1 extends java.applet.Applet { > private static final String COUNTRY_LABEL = "Canada"; > > private Label ivjlblCountry = null; > private int x = 20; > private int y = 20; > private int width = 20; > private int height = 20; > Panel ivjPanel1; > > public void init() { > setLayout(new BorderLayout(15,15)); > setBounds(x,y,width,height); > > add(BorderLayout.CENTER, getPanel1()); > } > > private java.awt.Panel getPanel1() { > if (ivjPanel1 == null) { > ivjPanel1 = new java.awt.Panel(); > ivjPanel1.setLayout(new > FlowLayout(FlowLayout.CENTER, 15, 15)); > ivjPanel1.setBounds(x,y,width,height); // this > ivjPanel1.add(getlblCountry()); // Each > > ivjPanel1.setBackground(Color.red); > } > > return ivjPanel1; > } > // All individual component getters looks like the following. > private java.awt.Label getlblCountry() { > if (ivjlblCountry == null) { > ivjlblCountry = new java.awt.Label(); > // IF I UNCOMMENT THE FOLLOWING LINE, THEN THE COMPONENT SHOWS > UP. > // ivjlblCountry.setBounds(x1,y1,w1,h1); > ivjlblCountry.setText(COUNTRY_LABEL); > } > > return ivjlblCountry; > } > } > > The layout is nasty, but I really don't have the time to clean it up. > > This shows an applet colored red with the word Canada at the top. From > what > I can see that looks right, so it may have been either the setSize or > the > add that was at fault. > > > --- > You are currently subscribed to jdjlist as: [EMAIL PROTECTED] > To unsubscribe send a blank email to > [EMAIL PROTECTED] > > --- > You are currently subscribed to jdjlist as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > --- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] --- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] --- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] --- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
