swing组件的问题!

Virginer 2001-06-01 08:54:00
我在做一个applet有用到JComboBox组件,但是在运行以后,
我发现它不能showPopup。各位大侠,请想想办法。多谢!
...全文
435 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)
Java编程语言一般是和重要的企业级应用程序联系在一起的,运行它们的服务器可能主位于蒙大拿的某个冰冷的机房里。不过,是桌面应用催生了Java,未来也必将是桌面应让Java能更加光彩夺目。通过AWT和现在的Swing,Java为编写图形化用户界面提供了丰富的客户端API。不过想要让Java、AWT和Swing达到最佳性能并不容易(也不方便),特别是在模拟交互式Web站点或像Windows XP和Mac OS X这样的操作系统外观时更是如此。\r\n 本书能帮助JAVA开发人员跳过Swing的基础节直接让桌面应用程序贴近现实。如果读者是一个Java开人员,并想开发带有一流外观的企业级应用程序,那就应该掌握Swing。不过对Swing的hack并不仅仅局限于对它的正常使用,而是关于一些读者或许要经过多年才能领会到的技巧。它们是一些富有创造性的、原创的甚至是诡异的hack,能让读者发出由衷的惊叹:“我可没想过居然能用Swing干这个!”\r\n 在本书中,读者将学到:\r\n 过滤不用的列表控件,对用户的输入做出合适的反应;\r\n 为列表和组合框组件提供拖放功能;\r\n 在图形组件之间实现动态效果,并能创建动态列表式界面;\r\n 控制任何方面,从鼠标指针到光标,乃至闪动键盘灯;\r\n 在Swing中构建分层、覆盖组件并灵活使用透明窗格屏蔽Swing接口内部的复杂细节和伸缩性。 ================================== 对学习SWING很有帮助!

62,614

社区成员

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

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