🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#8786
From: Rich Wilkman
Date: Thu, 20 Jul 2000 00:00
75 lines
2990 bytes
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: <3977A106.1E8EB093@formlessvoid.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8l777i$mco8@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,23bb6d0841df6fb9
X-Google-Attributes: gid111d45,public
From: Rich Wilkman <richw@formlessvoid.com>
Subject: Re: I've understood my problem but i can't fix it !
Date: 2000/07/20
Message-ID: <3977A106.1E8EB093@formlessvoid.com>
X-Deja-AN: 648903787
Content-Transfer-Encoding: 7bit
References: <8l777i$mco8@bornews.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Trace: 20 Jul 2000 17:52:21 -0800, 165.227.58.108
MIME-Version: 1.0
Reply-To: richw@formlessvoid.com
Newsgroups: borland.public.jbuilder.java.swing