Jlist default Value

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Jlist default Value

Postby mumu » Wed Aug 08, 2007 6:52 am

Comment peut-on mettre des valeurs par défaut dans une JList en utilisant uniquement le designer c'est à dire sans avoir à saisir aucune ligne de code.:?:
Merci
mumu
 
Posts: 2
Joined: Tue May 15, 2007 1:05 am

Re: Jlist default Value

Postby Eric Clayberg » Wed Aug 08, 2007 10:51 am

mumu wrote:How can one put default values in a JList by using only the designer i.e. without having to write any line of code.

If you are using the latest v6.4.1 build of Designer, you can click on the items property for the JList.

That will open a dialog where you can enter a list of items.

If you have an exiting model class, you can assign it to the JList via the model property.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby mumu105 » Mon Oct 15, 2007 3:03 am

Bonjour,
Je reprends cet ancien post car j'ai le même problème avec les JTables:

Pouvez vous me dire SVP, comment remplir les cellules d'une table en utilisant seulement swing designer, et donc sans faire de code?

Merci pour votre aide
mumu105
 
Posts: 2
Joined: Tue May 15, 2007 7:26 am

Postby Eric Clayberg » Mon Oct 15, 2007 4:05 am

mumu105 wrote:I resume this former post because I have the same problem with JTables:
Can you tell me please, how to fill cells in a table using only swing designer, and thus without making code?

JTables get their contents from a Table model.

You can create a model by hand or you can have Designer create a default Table model for you by double-clicking in the field next to the model property in the property pane.

Once the Table model property is created, you csn expand it to set the Table's columns.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest