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 130397

Summary: Table model is Microsoft smart when a column name starts with "Title"
Product: guibuilder Reporter: Petr Dvorak <joshis>
Component: CodeAssignee: issues@guibuilder <issues>
Status: NEW ---    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Table dialog is in the following state in the beginning
... and after you move the first row down, the result is like this... Is is really desired?

Description Petr Dvorak 2008-03-18 13:37:01 UTC
Product Version: NetBeans IDE Dev (Build 200803170003)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Linux version 2.6.24-12-generic running on i386; UTF-8; en_US (nb)

Just a silly me again. I would like to have a table for my favorite movies database with model having fields entitled
"Title 1", "Title 2" and "Title 3" (three favorite movie titles). So I insert a new JTable in the JFrame, then I create
table structure displayed in the screenshot. Then I decide to reorder items in the table, but the result is broken,
because "Title 2" automatically rewrites itself to "Title 1".

Problem is following: Numbering is based on the string pattern "Title [0-9]+" and the order of numbers is trying to be
kept "1,2,3,...". If you open the table model for the first time and select the first row in the table, then you move it
down, nothing changes. Title should be fixed, if you move a row down, it should be moved down.
Comment 1 Petr Dvorak 2008-03-18 13:38:10 UTC
Created attachment 58575 [details]
Table dialog is in the following state in the beginning
Comment 2 Petr Dvorak 2008-03-18 13:38:59 UTC
Created attachment 58576 [details]
... and after you move the first row down, the result is like this... Is is really desired?
Comment 3 Jan Stola 2008-03-18 14:44:29 UTC
It happens when the i-th column is named 'Title i' and when this column is moved => lowering priority.
Comment 4 Petr Dvorak 2008-03-18 15:49:00 UTC
If I can just suggest - it would be the best if the dialog didn't do anything like that. Just assign the titles "Title
i" and leave user to move it. Do not make it so smart... ;) I don't see the reason, why when you initially have the rows:

Title 1
Title 2
Title 3
Title 4

... and you move the first item down, you don't have:

Title 2
Title 1
Title 3
Title 4

I think this is what is expected, isn't it? :o)