I'm clearly missing something.
From: "Patrick Li" <[EMAIL PROTECTED]>
Reply-To: "jdjlist" <[EMAIL PROTECTED]>
To: "jdjlist" <[EMAIL PROTECTED]>
Subject: [jdjlist] RE: AWT components' platform dependency
Date: Thu, 13 Feb 2003 10:02:02 -0500
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]
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
