帮助使用Jsp代码中的组合框



下面是填充组合框的.jsp代码:

   <%
  {
  List <String> lststringIncidentIds = new ArrayList <String>();
  lststringIncidentIds.clear();
  String AllIds;
  AllIds = "";
  for (int i =0; i<wp.size();i++)
  {
 AllIds = "";
//1st work product
WorkProduct wpa;
wpa = wp.get(i);
//Metadata of Work Product
PackageMetadataType pms;
pms = wpa.getPackageMetadata();
IdentificationType Elementa;
pms.getPackageMetadataExtensionAbstract().get(0).getValue();
Elementa = (IdentificationType) 
wp.get(i).getPackageMetadata().getPackageMetadataExtensionAbstract().get(0).getValue();
AllIds = Elementa.getIdentifier().getValue();
lststringIncidentIds.add(AllIds);
out.println("Incident ID: " + i + " " +AllIds + "<br>"); 

我想把id变量传递给一个组合框

<body>
  <h1>Hello World!</h1>
     <%
       JFrame f;
       JComboBox cmbox;
       JPanel panel;

       //ComboBox b= new ComboBox();
       String course[] = {"BCA","MCA","PPC","CIC"};
       cmbox = new JComboBox(course);
       panel = new JPanel();
       panel.add(cmbox);
       //panel.setSize(400,400);
      //panel.setVisible(true);
       f=new JFrame("My Frame");
       f.add(panel);
       f.setSize(400,300);
       f.setVisible(true);
       %>
     </body>
      the combobox will not appear in the browser as its a swing component but this   
      code will help u understand the difference....try it...

相关内容

  • 没有找到相关文章

最新更新