简体   繁体   English

Netbeans:Java Swing:如何更改JComboBox Items的数据类型

[英]Netbeans: Java Swing: How can I change the datatype of JComboBox Items

I added a JComboBox to my JFrame inside the Design View and the datatype of its items is by default String: 我在设计视图内的JFrame中添加了一个JComboBox,默认情况下其项的数据类型为String:

private javax.swing.JComboBox<String> items;

The variable declaration is automatically added to the Source and cannot be edited. 变量声明将自动添加到源中,并且无法进行编辑。 Can someone tell me how I change the datatype of the items inside the Design View? 有人可以告诉我如何在“设计视图”中更改项目的数据类型吗? Or do I have to create the JComboBox Component inside the Source myself? 还是我必须自己在Source中创建JComboBox组件?

(I'm using NetBeans IDE 8.2; Java Version 1.8) (我使用的是NetBeans IDE 8.2; Java版本1.8)

In Properties -> Code -> Type Parameters 在“ Properties -> Code ->“ Type Parameters

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM