From 9ffc108c4d0afe927b9f9763bbfedac98d49f6e3 Mon Sep 17 00:00:00 2001 From: Keiji Ariyama Date: Wed, 4 May 2011 23:10:38 +0900 Subject: Displaying a filename to the titlebar when draw9-patch tool is invoked with specifying the filename. Change-Id: Icbf8c7a61d6c184df5ba46f39ca978cd55e67e93 --- draw9patch/src/com/android/draw9patch/ui/MainFrame.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'draw9patch/src') 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) { -- cgit v1.1