diff --git a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java index cbd805ab7..4f8c15f56 100644 --- a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java @@ -34,6 +34,7 @@ public class ContributedLibraryTableCellJPanel extends JPanel { final JPanel inactiveButtonsPanel; final JLabel statusLabel; final JTextPane description; + final TitledBorder titledBorder; private final String moreInfoLbl = tr("More info"); public ContributedLibraryTableCellJPanel(JTable parentTable, Object value, @@ -41,6 +42,11 @@ public class ContributedLibraryTableCellJPanel extends JPanel { super(); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + // Actual title set below + titledBorder = BorderFactory.createTitledBorder(""); + titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); + setBorder(titledBorder); + moreInfoButton = new JButton(moreInfoLbl); moreInfoButton.setVisible(false); installButton = new JButton(tr("Install")); @@ -120,9 +126,7 @@ public class ContributedLibraryTableCellJPanel extends JPanel { return; ContributedLibrary selected = releases.getSelected(); - TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName()); - titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); - setBorder(titledBorder); + titledBorder.setTitle(selected.getName()); Optional mayInstalled = releases.getInstalled(); boolean installable, upgradable; @@ -271,5 +275,7 @@ public class ContributedLibraryTableCellJPanel extends JPanel { // The description is not opaque, so copy our foreground color to it. if (description != null) description.setForeground(c); + if (titledBorder != null) + titledBorder.setTitleColor(c); } } diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java index 616bfbea6..75e26783d 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java @@ -67,6 +67,7 @@ public class ContributedPlatformTableCellJPanel extends JPanel { final JPanel inactiveButtonsPanel; final JLabel statusLabel; final JTextPane description; + final TitledBorder titledBorder; private final String moreInfoLbl = tr("More Info"); private final String onlineHelpLbl = tr("Online Help"); @@ -74,6 +75,11 @@ public class ContributedPlatformTableCellJPanel extends JPanel { super(); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + // Actual title set by update() + titledBorder = BorderFactory.createTitledBorder(""); + titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); + setBorder(titledBorder); + { installButton = new JButton(tr("Install")); moreInfoButton = new JButton(moreInfoLbl); @@ -186,9 +192,7 @@ public class ContributedPlatformTableCellJPanel extends JPanel { } ContributedPlatform selected = releases.getSelected(); - TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName()); - titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD)); - setBorder(titledBorder); + titledBorder.setTitle(selected.getName()); ContributedPlatform installed = releases.getInstalled(); boolean removable, installable, upgradable; @@ -311,5 +315,7 @@ public class ContributedPlatformTableCellJPanel extends JPanel { // The description is not opaque, so copy our foreground color to it. if (description != null) description.setForeground(c); + if (titledBorder != null) + titledBorder.setTitleColor(c); } }