diff options
author | Keiji Ariyama <keiji_ariyama@c-lis.co.jp> | 2011-05-04 23:10:38 +0900 |
---|---|---|
committer | Keiji Ariyama <keiji_ariyama@c-lis.co.jp> | 2011-05-04 23:10:38 +0900 |
commit | 9ffc108c4d0afe927b9f9763bbfedac98d49f6e3 (patch) | |
tree | eb7a44148248acf70e1f5d0474242a4e3544b0f4 /draw9patch/src | |
parent | 0683612e7a0c8b86149978a49e63b4fc14187da3 (diff) | |
download | sdk-9ffc108c4d0afe927b9f9763bbfedac98d49f6e3.zip sdk-9ffc108c4d0afe927b9f9763bbfedac98d49f6e3.tar.gz sdk-9ffc108c4d0afe927b9f9763bbfedac98d49f6e3.tar.bz2 |
Displaying a filename to the titlebar when draw9-patch tool is invoked with specifying the filename.
Change-Id: Icbf8c7a61d6c184df5ba46f39ca978cd55e67e93
Diffstat (limited to 'draw9patch/src')
-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) { |