lots of changes to text factory and swing pane