至于前四个3个嘛-_-! ,代码论坛上或者网上可能找到一些,但需要你自己去组织一下了。日历的。。当然java不象vb那样, vb是个快速开发工具,仅运于window的,倚赖了大量的现有的win32api和ActiveX组。。java是纯高级语言,所以实现起来需要手动的写一些类,不象vb那么容易。java的中文处理和vb更不一样,,vb是出了中文版,即要支持GBK又要支持big5等编码,java是unicode支持多国语言的,所以需要你手动的写一些代码 进行 中文编码转换。。版内也有很多jComboBox简单的用法sun上有,包括其他所有的Swing组件。http://java.sun.com/docs/books/tutorial/uiswing/index.html
怎么写还得自己动手啦。:)
怎么写还得自己动手啦。:)
解决方案 »
- 正则表达式问题
- java的一个小算法问题
- 抽象类和接口的作用到底是什么???
- 那儿的问题。。。
- 哪位能提供下载Java语言和库及其用户帮助手册的具体URL(最好能是中文版的)?感激!
- 求java的程序
- 菜鸟问题:JAVA中如何读取一个简单txt文件中的内容?
- rmi的简单例子本地机上测试通过,但在不同机上就出错(看在我搞了几天的份上,请大家进来帮帮我)
- 我已在一個.java文件中寫了package radom ,在javac時我怎樣才能創建,並把.class文件放到radom中??(
- JLabel加html标签仍不能自动换行?
- How can two threads communicate with each other?
- one bean with question ,help me!!!!thanks.
使用putClientProperty和getClientProperty方法,比VB好多了第三个问题:
使用第三方控件或自己写第二个问题:
使用putClientProperty和getClientProperty方法,比VB好多了第三个问题:
使用ComboBoxModel.addElement(Object obj),其中obj参数可以是任意的java对象,因此,你可以将带id和name属性的对象加进去,只是在该对象要有toString方法,返回显示在下拉列表中的名称第四个问题:
java api doc 是最好的教材
public class QuestionTypeInfo
{
private int type;
private String description; public QuestionTypeInfo()
{
} public QuestionTypeInfo(int type, String description)
{
this.type = type;
this.description = description;
}
public int getType()
{
return type;
} public void setType(int type)
{
this.type = type;
} public String getDescription()
{
return description;
} public void setDescription(String description)
{
this.description = description;
} public boolean equals(Object o)
{
if (this == o) return true;
if (!(o instanceof QuestionTypeInfo)) return false; final QuestionTypeInfo questionTypeInfo = (QuestionTypeInfo) o; if (type != questionTypeInfo.type) return false; return true;
} public int hashCode()
{
return type;
} public String toString()
{
return description;
}
}
DefaultComboBoxModel questionTypeModel = new DefaultComboBoxModel();
questionTypeModel.addElement(new QuestionTypeInfo(QuestionConstant.IMPERSONALITY_QUESTION, QuestionConstant.IMPERSONALITY_QUESTION_NAME));
questionTypeModel.addElement(new QuestionTypeInfo(QuestionConstant.SUBJECTIVE_QUESTION, QuestionConstant.SUBJECTIVE_QUESTION_NAME)); questionType.setModel(questionTypeModel);