Changeset 97 in tmcsimulator-scriptbuilder


Ignore:
Timestamp:
08/29/2017 10:10:44 AM (9 years ago)
Author:
bmcguffin
Message:

Fixed bug preventing the last incident in a timeslice from being deleted from its respective editor window. Also fixed a bug that caused an index-out-of-bounds error when deletions occurred too quickly, due to multithreading conflicts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/frame/Editor.java

    r94 r97  
    378378        int index = jTabbedPane1.getSelectedIndex(); 
    379379 
    380         if (index > 0 && jTabbedPane1.getTabComponentAt(index) != null) 
     380        if (index >= 0 && jTabbedPane1.getTabComponentAt(index) != null) 
    381381        { 
    382382            JPanel removable = (JPanel) jTabbedPane1 
     
    481481                    { 
    482482                    } 
    483                     jTabbedPane1.setTabComponentAt(index, title); 
     483                    if (index < jTabbedPane1.getTabCount()) 
     484                    { 
     485                        jTabbedPane1.setTabComponentAt(index, title); 
     486                    } 
    484487                    try 
    485488                    { 
     
    489492                    { 
    490493                    } 
    491                     jTabbedPane1.setForegroundAt(index, c); 
     494                    if (index < jTabbedPane1.getTabCount()) 
     495                    { 
     496                        jTabbedPane1.setForegroundAt(index, c); 
     497                    } 
    492498                } 
    493499            }).start(); 
Note: See TracChangeset for help on using the changeset viewer.