Net Beans中的JAVA小程序 [英] JAVA applets in Net Beans

查看:70
本文介绍了Net Beans中的JAVA小程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须开发一个java模拟器。我决定使用我的applet并对其进行编码。



在我的java applet中有一个组合框,当我单击1个组合框的值(值从1到10)时,我只想查看相应的文本字段。



但是当我单击组合框时,我无法查看相关的文本字段,当我单击任何其他按钮或单击栏时,它会显示文本字段。 />


我在组合框的ActionPerformed事件中编写了代码。我试着在组合框的ItemStateChanged事件中编写相同的代码。但我无法解决问题。



如何解决这个问题?



请帮助我。

I have to develop a java simulator. I decided my applet and code it.

In my java applet there is a combo box, and when I click 1 value of combo box( values from 1 to 10) I want to view corresponding text fields only.

But when I click the combo box I cannot view the relevant text fields and when I click any other button or click on the bar it displays text fields.

I have write the code inside ActionPerformed event of combo box. I tried to write the same code inside ItemStateChanged event of combo box. But I couldn''t fix the problem.

How can I get rid of this problem?

Please help me.

推荐答案

validate(); or  repaint(); or revalidate(); 

在创建textfiled或使其显示为true后,您是否调用了上述任何函数?如果没有解决,请发布您的代码

did you call any above function after creating the textfiled or making it visible true. If not resolve, then post your code


这篇关于Net Beans中的JAVA小程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆