This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 167841

Summary: JTable columnSelectionAllowed resets to true when editing via Table Contents dialog
Product: guibuilder Reporter: culli <culli>
Component: CodeAssignee: issues@guibuilder <issues>
Status: REOPENED ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description culli 2009-06-29 23:01:14 UTC
In the JTable properties, change the columnSelectionAllowed to unchecked/false (my JTable happens to be bound to an
Right-click on the JTable, choose Table Contents.
Click close.
columnSelectionAllowed is now checked/true again.  It should be left how I set it.
Comment 1 Jan Stola 2009-10-04 19:01:17 UTC
This is a misunderstanding. The columnSelectionAllowed property is set to checked/true when you close the Table 
Contents customizer because you have some Selection Model selected there. Of course, you can ask why the Selection 
Model is not set to Not Allowed in this case. Let me explain that: the 'Selection Model' combo in the Table Contents 
customizer corresponds to two properties - columnSelectionAllowed and columnModel. When you cancel setting of 
columnSelectionAllowed, but not cancel setting of columnModel then you leave the JTable in an inconsistent state - the 
column selection is not allowed (because you set columnSelectionAllowed property to false), but the column selection 
mode is still set to SINGLE_SELECTION/SINGLE_/MULTIPLE_INTERVAL_SELECTION (because columnModel property is not reset). 
Table Contents customizer have to deal with this situation somehow, it must ignore one of these inconsistent settings. 
It is a implementation detail that it ignores columnSelectionAllowed property in this case.

In other words, if you reset also the value of columnModel property (using Restore Default Value) then 
columnSelectionAllowed property will remain unchecked/false.
Comment 2 culli 2009-10-04 23:24:26 UTC
I disagree with your assessment -- you missed the point of my bug report entirely -- but it does not matter.  This is just 
one more bug in the GUI designer that has led me to stop using it.  It really is an annoying tool, and can only do 
extremely basic layouts without becoming highly frustrating.  It is difficult for me to maintain my GUIs that were built 
with Netbeans because of bugs like this one.  I get the UI set up to work just right.  Then it works fine for months.  I 
go in to add a column to the table, not changing any other settings, and now the selection model works differently.  This 
is completely unacceptable behavior and is only one of a dozen or more annoyances that add up to make the GUI designer 
unusable for me.

Back to MigLayout and hand coded GUIs!
Comment 3 luis.boch 2016-10-21 17:34:37 UTC
I have this issue with NB 8.2 (updated).
How to reproduce:

1 - Create new JFrame and add JTable
2 - Select JTable, check property "columnSelectionAllowed" and save.
3 - Close netbeans (maybe just close the screen designer, i dont know).
4 - Open netbeans again.
5 - Reopen the screen.
6 - Change column model (set/unset column as editable)
7 - Apply changes, here, the UI designer will "uncheck" (in my case) the property "columnSelectionAllowed" and aply it to code (I can see this change with diff tool).