SOLVED
Hi Guys so if I had a program that went like this:
import java.awt.*;
import javax.swing.*;
public class Tab extends JFrame
{
public Tab()
{
super ("Swimming Pool Calculator");
JTabbedPane tab = new JTabbedPane();
// constructing the first panel
JLabel l1 = new JLabel( "Welcome to blah,blah!", SwingConstants.CENTER);
JPanel p1 = new JPanel();
p1.add( l1 );
tab.addTab( "Tab#1", null, p1, " Panel #1" );
// constructing the second panel
JLabel l2 = new JLabel("Welcome to JTabbedPaneDemo",SwingConstants.CENTER);
JPanel p2 = new JPanel();
p2.setBackground( Color.blue );
p2.add( l2 );
tab.addTab( "Tab#2", null, p2, " Panel #2" );
}
}
And I wanted the wording in JLabel l1 to say:
"Welcome!
Thank you for using the
Swimming Pool Calculator.
How would I do this?
I tried to use the \n for new line but that didn’t work so well for me.
Swing components understand some HTML