Article View: borland.public.jbuilder.java.swing
Article #10352Positionnement ?
From: jean-christophe.ravarini
Date: Wed, 06 Oct 1999 00:00
Date: Wed, 06 Oct 1999 00:00
47 lines
1865 bytes
1865 bytes
Hi all,
Must be easy: I'm trying to set up a Frame with a label,
a textbox and a button. It works, but I cannot put fields
where I want to, on the form.
How do I do to set the positionning of the fields ?
Thanks,
Jean-Christophe Ravarini
Code sample:
//---------------------------------------------------------------------
private void jbInit() throws Exception
{
//Center the window
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int x = screenSize.width;
int y = screenSize.height;
//get user ID
Label lablUserID = new Label( "ID" );
TextField textUserID = new TextField( "", 16 );
Button buttOk = new Button( "OK" );
//some settings
this.getContentPane().setLayout(borderLayout1);
this.setSize(new Dimension(x/2,y/2));
this.setLocation( x/4, y/8 );
this.setTitle("Form #1");
//add2panel
this.getContentPane().add( lablUserID , BorderLayout.WEST );
this.getContentPane().add( textUserID , BorderLayout.NORTH );
this.getContentPane().add( buttOk , BorderLayout.SOUTH );
}
//---------------------------------------------------------------------
Sent via Deja.com http://www.deja.com/
Before you buy.
Technical Details
Message-ID:
<7tfjq0$p7c$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,b30dbe981ec86cf9,start X-Google-Attributes: gid111d45,public From: jean-christophe.ravarini@genebio.com Subject: Positionnement ? Date: 1999/10/06 Message-ID: <7tfjq0$p7c$1@nnrp1.deja.com> X-Deja-AN: 533467234 X-Http-Proxy: 1.1 x25.deja.com:80 (Squid/1.1.22) for client 194.6.173.103 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Oct 06 13:45:40 1999 GMT X-MyDeja-Info: XMYDJUIDravarini Newsgroups: borland.public.jbuilder.java.swing X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)