swing组件的问题!

Virginer 2001-06-01 08:54:00
我在做一个applet有用到JComboBox组件,但是在运行以后,
我发现它不能showPopup。各位大侠,请想想办法。多谢!
...全文
459 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
Virginer 2001-07-23
  • 打赏
  • 举报
回复
up
wolfsquare 2001-06-04
  • 打赏
  • 举报
回复
IE的Swing支持是SUN自己写的插件.
wolfsquare 2001-06-04
  • 打赏
  • 举报
回复
to treefield(都市蚂蚁) :
不是IE支持不好,是根本不支持Swing
fltwt 2001-06-04
  • 打赏
  • 举报
回复
升级JDK或JRE的版本到1.3.1。
如果你确信你的程序没问题的话。
treefield 2001-06-03
  • 打赏
  • 举报
回复
Swing在IE中有问题(IE支持不好)
wolfsquare 2001-06-01
  • 打赏
  • 举报
回复
我的是JBuilder +JDK1.2 & JBuilder +JDK1.3
IE JDK1.3通过,没有任何问题,除了 那个少了的 "b" 的border2 :)
Virginer 2001-06-01
  • 打赏
  • 举报
回复
谢谢大家了!
我在JBuilder中不能够showPopup,
但是在IE中就可以!
wolfsquare 2001-06-01
  • 打赏
  • 举报
回复
可以正常显示呀.
Virginer 2001-06-01
  • 打赏
  • 举报
回复
to wolfsquare(狼平方):
你看到问题所在了吗?
wolfsquare 2001-06-01
  • 打赏
  • 举报
回复
我这里没有问题.
Virginer 2001-06-01
  • 打赏
  • 举报
回复
请大家帮助我想想办法,谢谢了!
Virginer 2001-06-01
  • 打赏
  • 举报
回复
当然可以啊!
flyzhen 2001-06-01
  • 打赏
  • 举报
回复
你的JApplet在ie里能够看到吗?
Virginer 2001-06-01
  • 打赏
  • 举报
回复
JBuilder4.0 的JDK是java 1.3.0-C。
不是不能显示选择框,而是当点击时,
不能shopPopup。
binriyue 2001-06-01
  • 打赏
  • 举报
回复
你说哪一个选择框不能显示,我在我的jb里面都可以呀!
Virginer 2001-06-01
  • 打赏
  • 举报
回复
谢谢大家!
我用JBuilder4.0 Enterprise
Virginer 2001-06-01
  • 打赏
  • 举报
回复
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)
{
}
}
}
AUTOFANS 2001-06-01
  • 打赏
  • 举报
回复
具体点
binriyue 2001-06-01
  • 打赏
  • 举报
回复
把你的代码拿来看看呀。
wolfsquare 2001-06-01
  • 打赏
  • 举报
回复
不行就贴代码上来.
加载更多回复(3)

62,625

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧