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 180596 - Problem when removing last ItemCommand from
Summary: Problem when removing last ItemCommand from
Status: RESOLVED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Visual Designer (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Karol Harezlak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-11 03:23 UTC by carentrica
Modified: 2010-02-23 08:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description carentrica 2010-02-11 03:23:12 UTC
When removing the last ItemCommand from an Item in the Visual Designer, the ItemCommandListener implementation and commandAction() method are removed from the MIDlet declaration, but the 
.setItemCommandListener(this) assignment is NOT removed, resulting in an error...

public TextField getAmountTextField() {
    if (amountTextField == null) {
        // write pre-init user code here
        amountTextField = new TextField("Amount:",
                                  "", 32, TextField.DECIMAL);
        amountTextField.setItemCommandListener(this);  // <<<<-- ERROR!
        amountTextField.setLayout(Item.LAYOUT_LEFT | 
                                  Item.LAYOUT_NEWLINE_BEFORE | 
                                  Item.LAYOUT_EXPAND);
        // write post-init user code here
    }
    return amountTextField;
}
Comment 1 Karol Harezlak 2010-02-23 08:09:19 UTC
fixed in main,

changeset:

http://hg.netbeans.org/main/rev/76e07e415312