๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8704

Re: I've understood my problem but i can't fix it !

#8704
From: Velu Erwan
Date: Sat, 22 Jul 2000 00:00
82 lines
3355 bytes
it works well with JFrame but i've to add validate() & doLayout(๏ฟฝ when i
want to add a JComboBox on a panel at runtime.
Thanks everyone. !

Rich Wilkman <richw@formlessvoid.com> a ๏ฟฝcrit dans le message :
3977A106.1E8EB093@formlessvoid.com...
> Velu:
>
> Well, you should either be all JFC or no JFC to start.  So, convert your
> class to extend JFrame as a start.  Adjust the add calls to the
> appropriate getContentPane().add() calls as needed and try again.
>
> Hint:  Run the Application Wizard and use the JFrame in the Designer to
> see the appropriate syntax for getContentPane().add()...
>
> -Rich
>
> Velu Erwan wrote:
> >
> > I've learn about awt & swing since one week but i'm going to become
crazy !
> > I'm using JBuilder 2 with JDK 1.1.6 or 1.1.8.
> > I put a JComboBox on my Frame, the JComboBox works fine !
> > I put a JComboBox on a  Panel or JPanel or a GroupBox and my JComboBox
> > doesn't work fine.
> > When i click on it, it flashes !!!
> > It seems to be a problem of weight but it can resolve my problem.
> > Evenif i modify the value of lightWeightPopupEnable, it doesn't work !
> > Is it impossible to put a JComboBox on panel ? i think not, i must do a
> > mistake but where ?
> > It seems to be a simple program but .....
> > Here come a simple code that doesn't work as i want !
> >
> > PS: Great thanks for those who wants to help me !
> >
> > / * Beginning of the code*/
> >
> > package sans_titre8;
> > import java.awt.*;
> > import borland.jbcl.layout.*;
> > import borland.jbcl.control.*;
> > import com.sun.java.swing.*;
> >
> > public class Frame1 extends Frame{
> >   JPanel jPanel1 = new JPanel();
> >   JComboBox comboDoesntWorking = new JComboBox();
> >   XYLayout xYLayout1 = new XYLayout();
> >   JComboBox comboWorking = new JComboBox();
> >
> >   void Frame ()
> >   { }
> >
> >   public Frame1() {
> >     try  {
> >       jbInit();
> >     }
> >     catch (Exception e) {
> >       e.printStackTrace();
> >     }
> >   }
> >
> >   private void jbInit() throws Exception {
> >     this.setLayout(xYLayout1);
> >     comboDoesntWorking.setEditable(true);
> >     comboWorking.setEditable(true);
> >     this.add(jPanel1, new XYConstraints(17, 15, 226, 83));
> >     jPanel1.add(comboDoesntWorking, null);
> >     this.add(comboWorking, new XYConstraints(248, 132, 112, 26));
> >     comboDoesntWorking.addItem("t");
> >     comboDoesntWorking.addItem("t");
> >     comboWorking.addItem("t");
> >     comboWorking.addItem("t");
> >   }
> >
> >   public static void main (String args[])
> >   {Frame1 frame = new Frame1();
> >    frame.setSize(400,200);
> >    frame.setVisible(true);
> >   }
> >
> > }
> > /* End of the code*/
Technical Details
Message-ID: <8lam4t$l3l26@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8l777i$mco8@bornews.borland.com> <3977A106.1E8EB093@formlessvoid.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,23bb6d0841df6fb9
X-Google-Attributes: gid111d45,public
From: "Velu Erwan" <erwan@mandrakesoft.com>
Subject: Re: I've understood my problem but i can't fix it !
Date: 2000/07/22
Message-ID: <8lam4t$l3l26@bornews.borland.com>
X-Deja-AN: 649298499
References: <8l777i$mco8@bornews.borland.com> <3977A106.1E8EB093@formlessvoid.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing