public OurSyntaxWidget
(boolean enableSyntax, String text, String fontName, int fontSize, int tabSize, JComponent obj1, JComponent obj2) {
this.obj1 = obj1;
this.obj2 = obj2;
final OurSyntaxWidget me = this;
final ViewFactory defaultFactory = (new StyledEditorKit()).getViewFactory();
doc.do_enableSyntax(enableSyntax);
doc.do_setFont(fontName, fontSize, tabSize);
pane.setEditorKit(new StyledEditorKit() { // Prevents line-wrapping up to width=30000, and tells it to use our Document obj
@Override public Document createDefaultDocument() { return doc; }
@Override public ViewFactory getViewFactory() {
return new ViewFactory() {
public View create(Element x) {
if (!AbstractDocument.SectionElementName.equals(x.getName())) return defaultFactory.create(x);