JScrollPane or JSplitPane Problem.



Hey,
I'm writing an interface that has a verticle split pane, the top
and bottom of which both contain JScrollPanes with JEditor panes inside
each scrollpane. It sits within a JTabbedPane which is in a
JInternalFrame on a JDesktopPane.

JDesktopPane --> JTabbedPane --> Tab --> JSplitPane --> 2 ScrollPanes
--> 2 JEditorPanes.

The first EditorPane is a source area and the second is an error
output area. It's been working fine for me, which makes my current
dilema even worse.

I need to do the same format of error for an output tab so that
the output area is on top and the error output is on bottom. I took
the code from the previous working implementation and ported it and for
some reason it didn't work. The top component JScrollPane-->
JEditorPane does not show, but the bottom one does. Also, if I just
add the JScrollPane instead of the JSplitPane to the tab, it still
doesn't show, leading me to believe that it is a problem with the
implementation of the JScrollPane. Here are the code snippets of the
working and non-working portions of my code.

-----Working-----
source = new JEditorPane();
sourceError = new JEditorPane();
sourceError.setEditable(false);
JScrollPane scrollPane = new JScrollPane(source,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setBorder(BorderFactory.createEmptyBorder());
JScrollPane errorScrollPane = new JScrollPane(sourceError);
errorScrollPane.setBorder(BorderFactory.createEmptyBorder());
sourceSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane,
errorScrollPane);
sourceSplit.setBorder(BorderFactory.createEmptyBorder());
-----Not Working-----
expressionOut = new JEditorPane();
outputError = new JEditorPane();
expressionOut.setEditable(false);
outputError.setEditable(false);
JScrollPane outputScroller = new JScrollPane(expressionOut,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
outputScroller.setBorder(BorderFactory.createEmptyBorder());
JScrollPane outErrorScroller = new JScrollPane(outputError);
outErrorScroller.setBorder(BorderFactory.createEmptyBorder());
sourceSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
outputScroller,
outErrorScroller);
outputSplit.setBorder(BorderFactory.createEmptyBorder());
-----How They Are Added-----
tabFrame.addTab("Source", sourceSplit);
tabFrame.addTab("Output", outputSplit);
---------------
Any Ideas on why it isn't showing expressionOut?

.



Relevant Pages

  • JScrollPane or JSplitPane Problem.
    ... and bottom of which both contain JScrollPanes with JEditor panes inside ... implementation of the JScrollPane. ... JScrollPane scrollPane = new JScrollPane(source, ... sourceSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, ...
    (comp.lang.java.gui)
  • JScrollPane or JSplitPane Problem.
    ... and bottom of which both contain JScrollPanes with JEditor panes inside ... implementation of the JScrollPane. ... JScrollPane scrollPane = new JScrollPane(source, ... sourceSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, ...
    (comp.lang.java.gui)
  • JScrollPane or JSplitPane Problem.
    ... and bottom of which both contain JScrollPanes with JEditor panes inside ... implementation of the JScrollPane. ... JScrollPane scrollPane = new JScrollPane(source, ... sourceSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, ...
    (comp.lang.java.gui)
  • JSplitPane/JScrollPane Problem?
    ... and bottom of which both contain JScrollPanes with JEditor panes inside ... implementation of the JScrollPane. ... JScrollPane scrollPane = new JScrollPane(source, ... sourceSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, ...
    (comp.lang.java.gui)
  • JScrollPane or JSplitPane Problem.
    ... and bottom of which both contain JScrollPanes with JEditor panes inside ... implementation of the JScrollPane. ... JScrollPane scrollPane = new JScrollPane(source, ... sourceSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, ...
    (comp.lang.java.gui)