简体   繁体   English

如何使用NetBeans 7.4 GUI设计器更改JTable中的列数?

[英]How do I change the number of columns in a JTable using NetBeans 7.4 GUI designer?

I've created a JTable object using NetBeans 7.4. 我已经使用NetBeans 7.4创建了一个JTable对象。 By default it has four columns. 默认情况下,它有四列。 I only need two. 我只需要两个。 There is a columnCount property, but it is greyed out, so I can't change it. 有一个columnCount属性,但是它是灰色的,所以我不能更改它。 How do I set my column count to two? 如何将列数设置为2?

Within the properties of the JTable you can access a menu which is called "Model". 在JTable的属性中,您可以访问一个称为“模型”的菜单。 There you will get inside an editor, where you can edit the appearance of your JTable. 在那里,您将进入编辑器,可以在其中编辑JTable的外观。

在此处输入图片说明

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

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