H
hailang
Unregistered / Unconfirmed
GUEST, unregistred user!
html文件名为:MyJComboBox.html
<form name="form1" method="post" action="test.jsp">
<OBJECT CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="110" height="20" CODEBASE="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-win.cab#version=1,4,0,0">
<PARAM NAME =CODE values = "MyJComboBox.class" >
<PARAM NAME="type" values="application/x-java-applet">
<PARAM NAME="delay" values="100">
<PARAM NAME="isinteractive" values="false">
<PARAM NAME="steamanim" values="bf">
<PARAM NAME="cupanim" values="f">
<PARAM NAME="javaanim" values="sf">
</OBJECT>
<input type="submit" name="Submit" values="提交">
</form>
-----第二个文件,applet源码文件名为:MyJComboBox.java-----
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MyJComboBox extends JApplet
{
String[] fontsize={"A馆","B馆","B1馆","B2馆","B3馆","C馆","D馆","E馆","F1馆",
"D馆1号会议室","D馆2号会议室","D馆3号会议室","D馆4号会议室","D馆5号会议室",
"D馆6号会议室","D馆7号会议室","D馆8号会议室","D馆1号洽谈室","D馆2号洽谈室",
"D馆3号洽谈室","D馆4号洽谈室","F1馆洽谈室","1号贵宾厅","2号贵宾厅","3号贵宾厅",
"新闻发布厅","B馆会议室","C馆1号会议室","C馆2号会议室","多功能厅","客户服务中心",
"A馆前广场","B馆前广场","C馆前广场","D馆前广场"};
String defaultMessage="选择或输入";
Frame f=null;
public void init()
{
Container content=getContentPane();
for(Container c=this;c!=null;c=c.getParent())
{
if(c instanceof Frame)
f=(Frame)c;
}
JComboBox DD=new JComboBox(fontsize);
DD.setEditable(true);
ComboBoxEditor editor=DD.getEditor();
DD.configureEditor(editor,defaultMessage);
content.add(DD);
}
}
请问如何才能取得JComboBox输入或选择的值。如果有在网页中实现列表框既能输入又能选择的方法请详细说明。非常感谢。
<form name="form1" method="post" action="test.jsp">
<OBJECT CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="110" height="20" CODEBASE="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-win.cab#version=1,4,0,0">
<PARAM NAME =CODE values = "MyJComboBox.class" >
<PARAM NAME="type" values="application/x-java-applet">
<PARAM NAME="delay" values="100">
<PARAM NAME="isinteractive" values="false">
<PARAM NAME="steamanim" values="bf">
<PARAM NAME="cupanim" values="f">
<PARAM NAME="javaanim" values="sf">
</OBJECT>
<input type="submit" name="Submit" values="提交">
</form>
-----第二个文件,applet源码文件名为:MyJComboBox.java-----
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MyJComboBox extends JApplet
{
String[] fontsize={"A馆","B馆","B1馆","B2馆","B3馆","C馆","D馆","E馆","F1馆",
"D馆1号会议室","D馆2号会议室","D馆3号会议室","D馆4号会议室","D馆5号会议室",
"D馆6号会议室","D馆7号会议室","D馆8号会议室","D馆1号洽谈室","D馆2号洽谈室",
"D馆3号洽谈室","D馆4号洽谈室","F1馆洽谈室","1号贵宾厅","2号贵宾厅","3号贵宾厅",
"新闻发布厅","B馆会议室","C馆1号会议室","C馆2号会议室","多功能厅","客户服务中心",
"A馆前广场","B馆前广场","C馆前广场","D馆前广场"};
String defaultMessage="选择或输入";
Frame f=null;
public void init()
{
Container content=getContentPane();
for(Container c=this;c!=null;c=c.getParent())
{
if(c instanceof Frame)
f=(Frame)c;
}
JComboBox DD=new JComboBox(fontsize);
DD.setEditable(true);
ComboBoxEditor editor=DD.getEditor();
DD.configureEditor(editor,defaultMessage);
content.add(DD);
}
}
请问如何才能取得JComboBox输入或选择的值。如果有在网页中实现列表框既能输入又能选择的方法请详细说明。非常感谢。