From de212c1301e08f717ecc326485a5d634d1ab6148 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 30 May 2012 08:39:24 +0000 Subject: As of JDK 1.7, getTitleFont() sometimes return null - guard for that git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1080 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/gui/GetHardwareInfoGUI.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'BKUGuiExt/src/main') diff --git a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/GetHardwareInfoGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/GetHardwareInfoGUI.java index d4fbf900..e6265a07 100644 --- a/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/GetHardwareInfoGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/GetHardwareInfoGUI.java @@ -92,17 +92,19 @@ public class GetHardwareInfoGUI extends CardMgmtGUI implements backButton.addActionListener(hardwareinfolistener); backButton.setEnabled(true); - readerpanel_border = new TitledBorder(null, getMessage(LABEL_CARDREADER), TitledBorder.LEADING, TitledBorder.TOP, null, null); - readerpanel_border.setTitleFont(readerpanel_border.getTitleFont().deriveFont( - readerpanel_border.getTitleFont().getStyle() - & java.awt.Font.BOLD)); + readerpanel_border = new TitledBorder(null, getMessage(LABEL_CARDREADER), TitledBorder.LEADING, TitledBorder.TOP, null, null); + if (readerpanel_border.getTitleFont() != null) + readerpanel_border.setTitleFont(readerpanel_border.getTitleFont().deriveFont( + readerpanel_border.getTitleFont().getStyle() + & java.awt.Font.BOLD)); readerpanel = new JPanel(); readerpanel.setBorder(readerpanel_border); cardpanel_border = new TitledBorder(null, getMessage(LABEL_SMARTCARD), TitledBorder.LEADING, TitledBorder.TOP, null, null); - cardpanel_border.setTitleFont(cardpanel_border.getTitleFont().deriveFont( - cardpanel_border.getTitleFont().getStyle() - & java.awt.Font.BOLD)); + if (cardpanel_border.getTitleFont() != null) + cardpanel_border.setTitleFont(cardpanel_border.getTitleFont().deriveFont( + cardpanel_border.getTitleFont().getStyle() + & java.awt.Font.BOLD)); cardpanel = new JPanel(); cardpanel.setBorder(cardpanel_border); cardpanel.setFont(cardpanel.getFont().deriveFont( @@ -272,12 +274,12 @@ public class GetHardwareInfoGUI extends CardMgmtGUI implements (float) ((baseFontSize - 2)* factor))); } - if (cardpanel_border != null) { + if (cardpanel_border != null && cardpanel_border.getTitleFont() != null) { cardpanel_border.setTitleFont(cardpanel_border.getTitleFont().deriveFont( (float) ((baseFontSize)* factor))); } - if (readerpanel_border != null) { + if (readerpanel_border != null && readerpanel_border.getTitleFont() != null) { readerpanel_border.setTitleFont(readerpanel_border.getTitleFont().deriveFont( (float) ((baseFontSize)* factor))); } -- cgit v1.2.3