I have a JPanel with a TitledBorder called 'panelLogin' with white background on top of another JPanel colored blue.
Is there a way for the 'panelLogin' to lose the white edges outside of the TitledBorder to make it look nicer? I was hoping to get the TitledBorder look of the panel but without the excess white space outside.
JPanel panelBackground = new JPanel();
panelBackground.setBackground(new Color(70, 130, 180));
panelBackground.setBounds(0, 0, 316, 302);
panelBackground.setLayout(null);
JPanel panelLogin = new JPanel();
panelLogin.setBorder(new TitledBorder(null, "Login", TitledBorder.LEADING, TitledBorder.TOP,
new Font("Segoe UI", Font.BOLD, 14), null));
panelLogin.setBackground(Color.WHITE);
panelLogin.setBounds(10, 118, 296, 172);
panelBackground.add(panel_1);
Thanks in advance. I don't have enough rep yet to post an image so I could show. Sorry.