mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
fixed exception on close when trying to create sketch.properties on
linux and mac
This commit is contained in:
@@ -273,13 +273,15 @@ public class PdeBase implements ActionListener {
|
||||
new SketchbookMenuListener(subPath);
|
||||
|
||||
entries = subFolder.list();
|
||||
for (int j = 0; j < entries.length; j++) {
|
||||
if ((entries[j].equals(".")) ||
|
||||
(entries[j].equals(".."))) continue;
|
||||
//subMenu.add(entries[j]);
|
||||
MenuItem item = new MenuItem(entries[j]);
|
||||
item.addActionListener(subMenuListener);
|
||||
subMenu.add(item);
|
||||
if (entries != null) {
|
||||
for (int j = 0; j < entries.length; j++) {
|
||||
if ((entries[j].equals(".")) ||
|
||||
(entries[j].equals(".."))) continue;
|
||||
//subMenu.add(entries[j]);
|
||||
MenuItem item = new MenuItem(entries[j]);
|
||||
item.addActionListener(subMenuListener);
|
||||
subMenu.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
menu.add(subMenu);
|
||||
|
||||
@@ -990,9 +990,14 @@ public class PdeEditor extends Panel {
|
||||
// write sketch.properties
|
||||
try {
|
||||
URL url = getClass().getResource("buttons.gif");
|
||||
String urlstr = url.toString();
|
||||
urlstr = urlstr.substring(6, urlstr.lastIndexOf("/") + 1) +
|
||||
//String urlstr = url.toString();
|
||||
//System.out.println(url.getFile());
|
||||
//urlstr = urlstr.substring(6, urlstr.lastIndexOf("/") + 1) +
|
||||
//"sketch.properties";
|
||||
String urlstr = url.getFile();
|
||||
urlstr = urlstr.substring(0, urlstr.lastIndexOf("/") + 1) +
|
||||
"sketch.properties";
|
||||
|
||||
//System.out.println(urlstr);
|
||||
//System.exit(0);
|
||||
FileOutputStream output = new FileOutputStream(urlstr);
|
||||
|
||||
Reference in New Issue
Block a user