143 lines
5.0 KiB
HTML
143 lines
5.0 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="Creating a panel with GUI Builder" />
|
||
|
<meta name="abstract" content="" />
|
||
|
<meta name="description" content="" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="panelex" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Creating a panel with GUI Builder</title>
|
||
|
</head>
|
||
|
<body id="panelex"><a name="panelex"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Creating a panel with GUI Builder</h1>
|
||
|
<div><p></p>
|
||
|
<div class="section"><p>Creating a panel with GUI Builder is simple. From the menu bar
|
||
|
on the main GUI Builder window, select <span class="menucascade"><span class="uicontrol">File</span> > <span class="uicontrol">New File</span></span>.</p>
|
||
|
<p> From the menu bar on
|
||
|
the GUI Builder <strong>File</strong> window, click the Insert New Panel icon <img src="rzahh562.gif" alt="Insert New Panel tool icon" />
|
||
|
to display a panel builder where you can insert the components for your panel.
|
||
|
The toolbar buttons on the <strong>Panel</strong> window represent various components
|
||
|
that you can add to the panel. Select the component you want and then click
|
||
|
on the place you want to position it.</p>
|
||
|
<p>The following picture shows a
|
||
|
panel that has been created with several of the options available to you.</p>
|
||
|
<p><strong><span class="synph" id="panelex__panelexfig1"><a name="panelex__panelexfig1"><!-- --></a><span class="kwd"></span></span>Figure 1: Creating a sample Panel with
|
||
|
GUI Builder</strong> <img src="rzahh021.gif" alt="Sample panel created with GUI Builder" /> </p>
|
||
|
<p>The sample panel in <a href="#panelex__panelexfig1">Figure
|
||
|
1</a> uses the following DataBean code to bring together the various components:</p>
|
||
|
<pre>import com.ibm.as400.ui.framework.java.*;
|
||
|
|
||
|
public class PanelSampleDataBean extends Object
|
||
|
implements DataBean
|
||
|
{
|
||
|
private String m_sName;
|
||
|
private Object m_oFavoriteFood;
|
||
|
private ChoiceDescriptor[] m_cdFavoriteFood;
|
||
|
private Object m_oAge;
|
||
|
private String m_sFavoriteMusic;
|
||
|
|
||
|
public String getName()
|
||
|
{
|
||
|
return m_sName;
|
||
|
}
|
||
|
|
||
|
public void setName(String s)
|
||
|
{
|
||
|
m_sName = s;
|
||
|
}
|
||
|
|
||
|
public Object getFavoriteFood()
|
||
|
{
|
||
|
return m_oFavoriteFood;
|
||
|
}
|
||
|
|
||
|
public void setFavoriteFood(Object o)
|
||
|
{
|
||
|
m_oFavoriteFood = o;
|
||
|
}
|
||
|
|
||
|
public ChoiceDescriptor[] getFavoriteFoodChoices()
|
||
|
{
|
||
|
return m_cdFavoriteFood;
|
||
|
}
|
||
|
|
||
|
public Object getAge()
|
||
|
{
|
||
|
return m_oAge;
|
||
|
}
|
||
|
|
||
|
public void setAge(Object o)
|
||
|
{
|
||
|
m_oAge = o;
|
||
|
}
|
||
|
|
||
|
public String getFavoriteMusic()
|
||
|
{
|
||
|
return m_sFavoriteMusic;
|
||
|
}
|
||
|
|
||
|
public void setFavoriteMusic(String s)
|
||
|
{
|
||
|
m_sFavoriteMusic = s;
|
||
|
}
|
||
|
|
||
|
public Capabilities getCapabilities()
|
||
|
{
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public void verifyChanges()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public void save()
|
||
|
{
|
||
|
System.out.println("Name = " + m_sName);
|
||
|
System.out.println("Favorite Food = " + m_oFavoriteFood);
|
||
|
System.out.println("Age = " + m_oAge);
|
||
|
String sMusic = "";
|
||
|
if (m_sFavoriteMusic != null)
|
||
|
{
|
||
|
if (m_sFavoriteMusic.equals("RADIOBUTTON1"))
|
||
|
sMusic = "Rock";
|
||
|
else if (m_sFavoriteMusic.equals("RADIOBUTTON2"))
|
||
|
sMusic = "Jazz";
|
||
|
else if (m_sFavoriteMusic.equals("RADIOBUTTON3"))
|
||
|
sMusic = "Country";
|
||
|
}
|
||
|
System.out.println("Favorite Music = " + sMusic);
|
||
|
}
|
||
|
|
||
|
public void load()
|
||
|
{
|
||
|
m_sName = "Sample Name";
|
||
|
m_oFavoriteFood = null;
|
||
|
m_cdFavoriteFood = new ChoiceDescriptor[0];
|
||
|
m_oAge = new Integer(50);
|
||
|
m_sFavoriteMusic = "RADIOBUTTON1";
|
||
|
}
|
||
|
}</pre>
|
||
|
<p>The panel is the most simple component available within the
|
||
|
GUI Builder, but from a simple panel you can build great UI applications.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|