社区
Java SE
帖子详情
swing组件的问题!
Virginer
2001-06-01 08:54:00
我在做一个applet有用到JComboBox组件,但是在运行以后,
我发现它不能showPopup。各位大侠,请想想办法。多谢!
...全文
467
23
打赏
收藏
swing组件的问题!
我在做一个applet有用到JComboBox组件,但是在运行以后, 我发现它不能showPopup。各位大侠,请想想办法。多谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用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
Swing
中JPanel面板等
组件
实现实时渲染
问题
纪要!
这篇博客探讨了在Java
Swing
项目中如何处理显示
组件
的实时渲染
问题
。通过讲解repaint()和revalidate()函数,解释了这两个函数在数据刷新和布局管理中的作用。repaint()用于数据刷新,而revalidate()则类似前端的reload,负责重新布局和渲染
组件
。文中提供了一个包含单选按钮、复选框和按钮的Demo,展示了这两个函数的实际应用,以确保数据更新后的正确显示。
java
swing
组件
不显示_Java
Swing
图形
组件
无端影响父容器以及与父容器同一级别的其他
组件
显示状态(使其不显示),求帮忙找出
问题
在哪儿,谢谢!...
在开发Java
Swing
应用时,创建一个包含三个JPanel的JFrame,左侧Panel使用PicturePanel显示头像。当传递ImageIcon给PicturePanel时,图像无法显示且整个JFrame的其他
组件
消失。
问题
出现在PicturePanel类中,可能是
组件
布局或大小设置的
问题
,但窗口最小化再最大化后,
组件
会恢复正常。开发者寻求帮助找出
问题
所在。
SWing
组件
说明及使用
本文详细介绍了Java
Swing
组件
,包括顶级容器如JFrame、JApplet、JWindow和JDialog,面板
组件
如JPanel、JScrollPane、JSplitPane等,菜单相关
组件
如JMenuBar、JToolBar,以及各种基本
组件
和布局管理器。同时,还涵盖了事件监听,如MouseListener、KeyListener和ActionListener。
Swing
提供丰富的图形界面元素,支持跨平台且界面美观,是Java GUI开发的重要工具。
Swing
组件
本文围绕Java的
Swing
组件
展开,介绍了
Swing
组件
的类体系结构,如JFrame、JButton等各类
组件
的使用,还阐述了FlowLayout、BorderLayout等布局管理器。此外,详细说明了事件监听的步骤,以及java.awt.event包中的多种监听器,如ActionListener、KeyListener等。
Swing
组件
的使用【总结】
本文介绍了
Swing
作为Java的GUI开发工具集,其特点包括更好的可移植性和丰富的
组件
。详细讲解了JApplet、JButton、JPasswordField和JTabbedPane的使用,并强调了在
Swing
中添加
组件
需使用getContentPane().add()方法。此外,文章阐述了
Swing
的线程不安全特性,指出只能在事件派发线程中更新
组件
,推荐使用invokeLater或invokeAndWait方法确保线程安全。
Java SE
62,622
社区成员
307,257
社区内容
发帖
与我相关
我的任务
Java SE
Java 2 Standard Edition
复制链接
扫一扫
分享
社区描述
Java 2 Standard Edition
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章