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]

Reply via email to