Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / June 2006

Tip: Looking for answers? Try searching our database.

JScrollPane or JSplitPane Problem.

Thread view: 
Nuvious - 29 Jun 2006 19:12 GMT
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?
Nuvious - 29 Jun 2006 19:13 GMT
I have no idea why it posted 4 times.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.