public void addDocument(String path) { if (!(new File(path)).exists()) { JOptionPane.showMessageDialog(this, "Error opening file: \"" + path + "\""); return; } JComponent editor = createTextArea(path); editor.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14)); final DocumentComponent txtDocument = new DocumentComponent(new JScrollPane(editor), path, path, JideIconsFactory.getImageIcon(JideIconsFactory.FileType.TEXT)); txtDocument.setDefaultFocusComponent(editor); list.add(0,txtDocument); pane.setOpenedDocuments(list); pane.getLayoutPersistence().setProfileKey("documents"); pane.getLayoutPersistence().loadLayoutData(); this.pack(); this.setVisible(true); }
public void addDocument(String path) { if (!(new File(path)).exists()) { JOptionPane.showMessageDialog(this, "Error opening file: \"" + path + "\""); return; } JComponent editor = createTextArea(path); editor.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14)); final DocumentComponent txtDocument = new DocumentComponent(new JScrollPane(editor), path, path, JideIconsFactory.getImageIcon(JideIconsFactory.FileType.TEXT)); txtDocument.setDefaultFocusComponent(editor); list.add(0,txtDocument); pane.setOpenedDocuments(list); pane.getLayoutPersistence().setProfileKey("documents"); pane.getLayoutPersistence().loadLayoutData(); this.pack(); this.setVisible(true); }
getMainFrame().getLayoutPersistence().loadLayoutData(); // </JIDE> clearStatusBarMessage(); pm.worked(1);