diff options
-rw-r--r-- | draw9patch/src/com/android/draw9patch/ui/MainFrame.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/draw9patch/src/com/android/draw9patch/ui/MainFrame.java b/draw9patch/src/com/android/draw9patch/ui/MainFrame.java index bf8ff77..57f6cd9 100644 --- a/draw9patch/src/com/android/draw9patch/ui/MainFrame.java +++ b/draw9patch/src/com/android/draw9patch/ui/MainFrame.java @@ -40,9 +40,15 @@ public class MainFrame extends JFrame { private JMenuItem saveMenuItem; private ImageEditorPanel imageEditor; + private static final String TITLE_FORMAT = "Draw 9-patch: %s"; + public MainFrame(String path) throws HeadlessException { super("Draw 9-patch"); + if (path != null) { + setTitle(String.format(TITLE_FORMAT, path)); + } + buildActions(); buildMenuBar(); buildContent(); @@ -164,7 +170,7 @@ public class MainFrame extends JFrame { protected void done() { try { showImageEditor(get(), file.getAbsolutePath()); - MainFrame.this.setTitle(String.format("Draw 9-patch: %s", file.getAbsolutePath())); + setTitle(String.format(TITLE_FORMAT, file.getAbsolutePath())); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { |