import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import javax.swing.*;
import javax.swing.border.*;public class PanlelText extends JApplet
{
   //private InetAddress remote;
   //private RemoteDataTable dt;
   //private long handle = 0;
   //private String SoftPLC = "192.168.78.224";
   //private String sDataTable = "n007:002";  boolean isStandalone = false;
  JComboBox jComboBox1 = new JComboBox();
  JComboBox jComboBox2 = new JComboBox();
  Border border1;
  JComboBox jComboBox3 = new JComboBox();
  JButton jButton1 = new JButton();
  JLabel jLabel1 = new JLabel();
  JLabel jLabel2 = new JLabel();
  JLabel jLabel3 = new JLabel();
  JLabel jLabel4 = new JLabel();
  Border border2;
  FlowLayout flowLayout1 = new FlowLayout();
  /**Get a parameter value*/
  public String getParameter(String key, String def)
  {
    return isStandalone ? System.getProperty(key, def) :
      (getParameter(key) != null ? getParameter(key) : def);
  }  /**Construct the applet*/
  public PanlelText()
  {
    /*try
    {
      remote = InetAddress.getByName( SoftPLC );
      dt = new RemoteDataTable( null, remote, 500 );
      handle = dt.handle( sDataTable );
    }catch( Exception e1)
   {
      return;
    }*/
  }
  /**Initialize the applet*/
  public void init()
  {
    try
    {
      jbInit();
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }
  /**Component initialization*/
  private void jbInit() throws Exception
  {
    jComboBox1.addItem("aa");
    jComboBox1.addItem("bb");
    jComboBox2.addItem("aa");
    jComboBox2.addItem("bb");
    jComboBox3.addItem("aa");
    jComboBox3.addItem("bb");    JPanel jPanel1 = new JPanel();
    order2 = BorderFactory.createEmptyBorder();
    this.setSize(new Dimension(500, 191));    jPanel1.setBackground(new Color(192, 192, 255));
    jPanel1.setBorder(BorderFactory.createEtchedBorder());
    jPanel1.setToolTipText("");    JPanel jPanel2 = new JPanel();
    jPanel2.setBorder(BorderFactory.createEtchedBorder());
    jPanel2.setLayout(flowLayout1);    jComboBox1.setAutoscrolls(true);
    jComboBox1.setBorder(BorderFactory.createEtchedBorder());
    jComboBox1.setPreferredSize(new Dimension(60, 20));
    jComboBox3.setBorder(border2);
    jComboBox3.setPreferredSize(new Dimension(60, 20));    jComboBox2.setAutoscrolls(true);
    jComboBox2.setBorder(BorderFactory.createEtchedBorder());
    jComboBox2.setPreferredSize(new Dimension(60, 20));
    jComboBox2.setEditor(null);
    jButton1.setBorder(BorderFactory.createEtchedBorder());
    jButton1.setPreferredSize(new Dimension(60, 20));
    jButton1.setText("OK");    jLabel1.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel1.setText("模块类型");
    jLabel2.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel2.setText("模块位置");
    jLabel3.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel3.setText("通道号");
    jLabel4.setFont(new java.awt.Font("Dialog", 1, 5));
    jLabel4.setToolTipText("");
    jLabel4.setText("  ");
    this.getContentPane().add(jPanel1, BorderLayout.WEST);
    this.getContentPane().add(jPanel2, BorderLayout.EAST);
    jPanel2.add(jLabel1, null);
    jPanel2.add(jComboBox1, null);
    jPanel2.add(jLabel2, null);
    jPanel2.add(jComboBox2, null);
    jPanel2.add(jLabel3, null);
    jPanel2.add(jComboBox3, null);
    jPanel2.add(jLabel4, null);
    jPanel2.add(jButton1, null);
    jPanel1.setPreferredSize(new Dimension(430, 191));
    jPanel2.setPreferredSize(new Dimension(70, 191));  }
  /**Get Applet information*/
  public String getAppletInfo()
  {
    return "Applet Information";
  }
  /**Get parameter info*/
  public String[][] getParameterInfo()
  {
    return null;
  }  //static initializer for setting look & feel
  static
  {
    try {
      //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    }
    catch(Exception e)
    {
    }
  }
 }

解决方案 »

  1.   

    谢谢大家!
    我用JBuilder4.0 Enterprise
      

  2.   

    JBuilder4.0 的JDK是java 1.3.0-C。
    不是不能显示选择框,而是当点击时,
    不能shopPopup。
      

  3.   

     你的JApplet在ie里能够看到吗?
      

  4.   

    to wolfsquare(狼平方):
    你看到问题所在了吗?
      

  5.   

    谢谢大家了!
    我在JBuilder中不能够showPopup,
    但是在IE中就可以!
      

  6.   

    我的是JBuilder +JDK1.2 & JBuilder +JDK1.3 
    IE JDK1.3通过,没有任何问题,除了 那个少了的 "b" 的border2 :)
      

  7.   

    Swing在IE中有问题(IE支持不好)
      

  8.   

    to treefield(都市蚂蚁) :
       不是IE支持不好,是根本不支持Swing
      

  9.   

    IE的Swing支持是SUN自己写的插件.
      

  10.   

    升级JDK或JRE的版本到1.3.1。
    如果你确信你的程序没问题的话。