From 4de3c944d54144fe4ee069fbfdf50a7391f44e84 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 23 Jul 2015 15:24:23 +0200 Subject: [PATCH] =?utf8?q?Moved=20declaration=20of=20menu=20and=20item=20i?= =?utf8?q?nstances=20up=20as=20they=20will=20be=20used=20again=20Signed-of?= =?utf8?q?f-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../client/gui/AddressbookFrame.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java b/Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java index 7310100..a8507fb 100644 --- a/Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java +++ b/Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java @@ -205,16 +205,18 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame // Center window in middle of screen, instead of top-left corner this.frame.setLocationRelativeTo(null); - // Init menu bar in north + // Init menu bar, menu and item instances JMenuBar menuBar = new JMenuBar(); + JMenu menu; + JMenuItem item; // Init some menus: // 1) File menu - JMenu menu = new JMenu(this.getBundle().getString("AddressbookFrame.menu.file.text")); + menu = new JMenu(this.getBundle().getString("AddressbookFrame.menu.file.text")); // Add menu items: // 1.x) Exit program (should be last) - JMenuItem item = new JMenuItem(this.getBundle().getString("AddressbookFrame.menuItem.exitProgram.text")); + item = new JMenuItem(this.getBundle().getString("AddressbookFrame.menuItem.exitProgram.text")); item.setToolTipText(this.getBundle().getString("AddressbookFrame.menuItem.exitProgram.toolTipText")); // Add listener to exit menu @@ -243,13 +245,13 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame this.statusLabel = new JLabel(this.getBundle().getString("AddressbookFrame.statusLabel.initializing.text")); // Init status bar in south - JPanel statusPanel = new JPanel(); - statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.X_AXIS)); - statusPanel.add(this.statusLabel); - statusPanel.setBorder(BorderFactory.createEtchedBorder()); + JPanel panel = new JPanel(); + panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); + panel.add(this.statusLabel); + panel.setBorder(BorderFactory.createEtchedBorder()); // Add panel to frame - this.frame.add(statusPanel, BorderLayout.SOUTH); + this.frame.add(panel, BorderLayout.SOUTH); } } -- 2.39.5