public EditTiffG() { setTitle(TITLE); setLayout(new BorderLayout()); textArea = new JTextArea(25, 80); add(new JScrollPane(textArea), BorderLayout.CENTER); //textArea.setWrapStyleWord(true); textArea.setLineWrap(true); JMenuBar menubar = new JMenuBar(); setJMenuBar(menubar); JMenu file = new JMenu("File"); menubar.add(file); JMenuItem fileOpen = new JMenuItem("Open"); file.add(fileOpen); fileOpen.addActionListener(this); fileOpen.setActionCommand("open"); JMenuItem fileSave = new JMenuItem("Save"); file.add(fileSave); fileSave.addActionListener(this); fileSave.setActionCommand("save"); JMenuItem fileExit = new JMenuItem("Exit"); file.add(fileExit); fileExit.addActionListener(this); fileExit.setActionCommand("exit"); fileBox = new JFileChooser(System.getProperty("user.dir")); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); setVisible(true); }
public EditTiffG() { setTitle(TITLE); setLayout(new BorderLayout()); textArea = new JTextArea(25, 80); add(new JScrollPane(textArea), BorderLayout.CENTER); //textArea.setWrapStyleWord(true); textArea.setLineWrap(true); JMenuBar menubar = new JMenuBar(); setJMenuBar(menubar); JMenu file = new JMenu("File"); menubar.add(file); JMenuItem fileOpen = new JMenuItem("Open"); file.add(fileOpen); fileOpen.addActionListener(this); fileOpen.setActionCommand("open"); JMenuItem fileSave = new JMenuItem("Save"); file.add(fileSave); fileSave.addActionListener(this); fileSave.setActionCommand("save"); JMenuItem fileExit = new JMenuItem("Exit"); file.add(fileExit); fileExit.addActionListener(this); fileExit.setActionCommand("exit"); fileBox = new JFileChooser(System.getProperty("user.dir")); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); setVisible(true); }
public void openFile(File f) { try { String id = f.getAbsolutePath(); String xml = new TiffParser(id).getComment(); setXML(xml); file = f; setTitle(TITLE + " - " + id); } catch (IOException exc) { showError(exc); } }
public void openFile(File f, RandomAccessInputStream in) { try { String id = f.getAbsolutePath(); String xml = new TiffParser(in).getComment(); setXML(xml); file = f; setTitle(TITLE + " - " + id); } catch (IOException exc) { showError(exc); } }
public void openFile(File f) { try { String id = f.getAbsolutePath(); String xml = new TiffParser(id).getComment(); setXML(xml); file = f; setTitle(TITLE + " - " + id); } catch (IOException exc) { showError(exc); } }
public void openFile(File f, RandomAccessInputStream in) { try { String id = f.getAbsolutePath(); String xml = new TiffParser(in).getComment(); setXML(xml); file = f; setTitle(TITLE + " - " + id); } catch (IOException exc) { showError(exc); } }