From 5bff0a3288bd2b5e1f1030c6e47430735cd09463 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 9 Jul 2009 16:34:07 +0000 Subject: [#393] loading of default background fails git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@407 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 2 +- .../main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java | 31 +++++----------------- 2 files changed, 8 insertions(+), 25 deletions(-) (limited to 'BKUCommonGUI/src/main/java') diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java index 79fbfd6c..06aad45f 100644 --- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java @@ -42,7 +42,7 @@ public interface BKUGUIFacade { public static final String ERR_CONFIG = "error.config"; public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages"; - public static final String DEFAULT_BACKGROUND = "/images/BackgroundChipperling.png"; + public static final String DEFAULT_BACKGROUND = "/images/ChipperlingCutoff.png"; public static final String DEFAULT_ICON = "/images/ChipperlingLogo.png"; public static final String HELP_IMG = "/images/help.png"; public static final String HASHDATA_FONT = "Monospaced"; diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java index 4cab29e0..16297218 100644 --- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java @@ -28,25 +28,15 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.text.MessageFormat; -import java.util.Collections; import java.util.List; import java.util.Locale; -import java.util.MissingResourceException; import java.util.ResourceBundle; import javax.swing.GroupLayout; import javax.swing.ImageIcon; import javax.swing.JButton; -import javax.swing.JFileChooser; import javax.swing.JLabel; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JScrollPane; @@ -153,10 +143,7 @@ public class BKUGUIImpl implements BKUGUIFacade { initIconPanel(background); initContentPanel(null); } else { - initContentPanel((background == null) ? - getClass().getResource(DEFAULT_BACKGROUND) : - background - ); + initContentPanel(background); } GroupLayout layout = new GroupLayout(contentPane); @@ -220,20 +207,16 @@ public class BKUGUIImpl implements BKUGUIFacade { protected void initContentPanel(URL background) { -// if (background == null) { -// background = getClass().getResource(DEFAULT_BACKGROUND); -// } if (background == null) { log.debug("no background image set"); +// contentPanel = new ImagePanel(getClass().getResource(DEFAULT_BACKGROUND)); + contentPanel = new JPanel(); + } else if ("file".equals(background.getProtocol())) { + log.warn("file:// background images not permitted: " + background); contentPanel = new JPanel(); } else { - if ("file".equals(background.getProtocol())) { - log.warn("file:// background images not permitted: " + background + - ", loading default background"); - background = getClass().getResource(DEFAULT_BACKGROUND); - } - log.debug("loading background " + background); - contentPanel = new ImagePanel(background); + log.debug("loading background " + background); + contentPanel = new ImagePanel(background); } mainPanel = new JPanel(); mainPanel.setOpaque(false); -- cgit v1.2.3