Okay ... In my main GUI file .. I have declared this ...
tab.add(new EditArea("TextAreaName"), "TabName"); // Not showing my TextArea
and
tab.add(new JScrollPane(new TextArea("TextAreaName")), "TabName"); // Does show my text area
where tab is a JTabbedPane, TextArea is a class that extends JEditorPane, and Edit Area is a class that extends JScrollPane.
This is the code for my EditArea():
public class EditArea extends JScrollPane {
public EditArea(
String nameOfTextArea) {
add(new TextArea(nameOfTextArea));
}
}
I dont see any logical differences in the code .. but the first tab shows just a big container with nothing in it, but the second tab shows the correct JEditorPane window. What am I doing wrong?