diff --git a/src/cuploader/PFile.java b/src/cuploader/PFile.java index 4a945779..8981d6b5 100644 --- a/src/cuploader/PFile.java +++ b/src/cuploader/PFile.java @@ -57,6 +57,7 @@ public final class PFile extends javax.swing.JPanel implements KeyListener { int rotateThumb = 0; //rotate thumbnail FInfo fExif; // subwindow exif public FCoord fCoord; // subwindow coordinates + boolean ready = false; //info public File file; @@ -83,9 +84,11 @@ public PFile(File file, int number) { this.number = number; initComponents(); + ready = true; addUndo(); addKeyListener(this); TransferFocus.patch(tDesc); + ready = true; String name = file.getName(); tName.setText(name.substring(0, name.lastIndexOf('.'))); @@ -109,6 +112,7 @@ public PFile(File file, int number, boolean toUpload, boolean toEdit, String nam } initComponents(); + ready = true; addUndo(); addKeyListener(this); TransferFocus.patch(tDesc); @@ -1137,7 +1141,9 @@ public void generateThumbnail() { @Override public void setName(String text) { - tName.setText(text); + if (ready) { + tName.setText(text); + }; } public void setDate(String text) { @@ -1187,6 +1193,15 @@ public String getComponent(Elem component) { } } + @Override + public String getName() { + if (ready) { + return tName.getText(); + } else { + return ""; + } + }; + public String getExt() { return ext; }; public void setAsUploaded() {