The scenerio is that I have different type of drawing components on drawing area. In menu I have some combo boxes which apply different properties on these objects. and also add a new UndoableEdit to the UndoManager. Anybody worked with the swing's undo package will get the idea. This way I am successfully performing undo and redo functionality. But the problem is in many cases I need to update the state of these combo boxes for example when a new object is added, appropriate value in the combo boxes has to be selected or when user selects another object, I update the selected index of the combo boxes. On calling the setSelectedIndex() function of these combo boxes the actionPerformed method of the combobox is automatically called which also adds a new undoableEdit into the UndoManager which is not desired since user has not performed any action on the combobox to update the property but I dynamically updated the state of the combobox to match it with the currently selected object. Anybody has solution to this problem?
dasatti 0 Junior Poster in Training
designpattern 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.