Problem in jsplitpane

Hi friends,
I'm creating a swing application.i've done a split on a jframe using jsplitpane.i'm doing the vertical split at the first time. In the top component i'm having the application name and in the bottom component i've some links to bring up the next screen.Once the user click on the link i'm trying to split the bottom component into another two parts and i'm trying to populate the information.
i'm using the same frame to get the next screen.here the problem is i'm not able to split the bottom component.
how to get the bottom component alone and do the split of the bottom component into two parts?
Edited by: sivabalan on Apr 17, 2008 4:46 AM
Edited by: sivabalan on Apr 17, 2008 5:05 AM

Thanks ashwini.
i'm posting my code here.here the requirement is i need the frame to be split @ run time.kindly execute the below code so that u can get the clear idea abt the requirement.In this first screen i've done a split.so we'll be able to view the title @ the top component and @ the bottom component there'll be link to navigate to the next stage of the application. Exactly here i'm getting the problem. if we clik on this link we can able to see the next stage details. but i need only the bottom component to be split this time. insead of this itz taking the whole frame and spliting into two parts and giving the details. so because of that the application name is getting shrinked.
The top component of the first screen should always needs to be static. I need only the bottom component to be dynamic.
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagLayout;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
public class test extends JPanel //implements KeyListener
     static Vector<String> arrAppName     = new Vector<String>();
     public static JSplitPane splitPane;
     public void AppWin( final JFrame frame)
          Container contentPane = this;
          GridBagLayout gb = new GridBagLayout();
          contentPane.setLayout(gb);
          arrAppName.add("link");
          JLabel lab=new JLabel("<html><font color=#6698FF><a href>"+arrAppName.get(0)+ "</a></font></html>");
          contentPane.add(lab);
          JScrollPane listScrollPane= new JScrollPane(contentPane);
        JLabel label = new JLabel("APPLICATION REPORT",JLabel.CENTER);
        Font font = label.getFont();
        Font font3 = font.deriveFont(25.0f);
        label.setFont(font3);
        label.setFont(label.getFont().deriveFont(Font.ITALIC));
        label.setHorizontalAlignment(JLabel.CENTER);
        label.setForeground(new Color(0x736AFF));
        JScrollPane labelScrollPane = new JScrollPane(label);
        labelScrollPane.setVisible(true);
        contentPane.add(labelScrollPane);
        //Create a split pane with the two scroll panes in it.
        splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        splitPane.setTopComponent(labelScrollPane);
        splitPane.setBottomComponent(listScrollPane);
        splitPane.setDividerLocation(100);
        Dimension minimumSize = new Dimension(100, 50);
        listScrollPane.setMinimumSize(minimumSize);
        labelScrollPane.setMinimumSize(minimumSize);
          lab.addMouseListener(new MouseListener(){
               public void mouseClicked(MouseEvent arg0) {
                              displayMainFrame("link",frame);
                         public void mousePressed(MouseEvent arg0) {
                         public void mouseReleased(MouseEvent arg0) {
                         public void mouseEntered(MouseEvent arg0) {
                         public void mouseExited(MouseEvent arg0) {
     public void buildWindow( String  link,JFrame frame)
          Container contentPane = this;
          GridBagLayout gb = new GridBagLayout();
          contentPane.setLayout(gb);
          JLabel label = new JLabel("Next Screen",JLabel.CENTER);
        Font font = label.getFont();
        Font font3 = font.deriveFont(25.0f);
        label.setFont(font3);
        label.setFont(label.getFont().deriveFont(Font.ITALIC));
        label.setHorizontalAlignment(JLabel.CENTER);
        label.setForeground(new Color(0x736AFF));
        JScrollPane buildWindowtop = new JScrollPane(label);
        buildWindowtop.setVisible(true);
        contentPane.add(buildWindowtop);
        JSplitPane splitPane1 = new JSplitPane();
        splitPane1=splitPane;
/*(if i try like below line i'm getting error as: "Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.JScrollPane")*/
       //splitPane1=(JSplitPane) splitPane.getBottomComponent();
        splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,splitPane1,buildWindowtop);
        splitPane.setOneTouchExpandable(true);
        splitPane.setDividerLocation(250);
        Dimension minimumSize = new Dimension(100, 50);
        buildWindowtop.setMinimumSize(minimumSize);
        splitPane1.setMinimumSize(minimumSize);
          } // end printing rows
      public static void  displayFrame(String tname, JFrame framedisp,String buttonName,String tranCorrID,String buttonOption,JSplitPane buildSplit)
                 AlignTest mainDispPane = new AlignTest();
                 mainDispPane.buildSpecificWindow(tname,framedisp,buttonName,tranCorrID,buttonOption,buildSplit);
                 framedisp.getContentPane().add(splitPane);
               framedisp.setVisible(true);
       public static void  displayMainFrame(String link,JFrame framedisp)
               test mainDispPane = new test();
               mainDispPane.buildWindow(link,framedisp);
               framedisp.getContentPane().add(splitPane);
               framedisp.setVisible(true);
     public static void main(String[] args)
               JFrame frame = new JFrame("MAIN WINDOW");
               frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               test mainPane = new test();
               mainPane.AppWin(frame);
               frame.getContentPane().add(splitPane);
               frame.setSize(1280, 1000);
               frame.setVisible(true);
          } // end main
} // end AlignTestEdited by: sivabalan on Apr 17, 2008 11:11 PM

Similar Messages

  • Problem with JSplitPane

    Hi!
    I have the following problem with JSplitPane: Whenever I add two components to the splitpane and then add the splitpane to a JPanel, the left component is minimized, i.e. not visible. I always have to manually readjust the splitter in order to see the left component. I also tried a bunch of combinations of setSize, etc. but nothing seems to help.
    Here's some code:
    public void setTables(Vector<DBTable> vec)
              _panel.setSize(650, 500);
              DefaultListModel m = new DefaultListModel();
              _tableList = new JList(m);
              // _tableList.setSize(new Dimension(300, 400));
              _infoArea = new JTextArea();
              _infoArea.setEditable(false);
              // _infoArea.setSize(new Dimension(250, 300));
              MetaDataListener listener = new MetaDataListener(_infoArea, _tableList);
              _tableList.addListSelectionListener(listener);
              for (DBTable table : vec)
                   m.addElement(table);
              JScrollPane scroll1 = new JScrollPane(_tableList);
              JScrollPane scroll2 = new JScrollPane(_infoArea);
              JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, scroll1, scroll2);
              split.setSize(new Dimension(600, 480));
              _panel.add(split, BorderLayout.CENTER);
              scroll1.setPreferredSize(new Dimension(300, 400));
              scroll1.setSize(new Dimension(300, 400));
              scroll2.setPreferredSize(new Dimension(300, 400));
              scroll2.setSize(new Dimension(300, 400));
              _panel.setVisible(true);
                                         //_frame referes to a JInternalFrame and _panel surprisingly to a JPanel
              _frame.getContentPane().add(_panel, BorderLayout.CENTER);
              _frame.setVisible(true);
              split.setDividerLocation(50.0);
         }Thanks!

    Nevermind I fixed it!

  • Big problem with JSplitPane

    Hello,
    I feel I'm going mad with Swing.
    I have a main main JTabbedPane: main.
    First component: JEditorPane : source
    Second Component: JPanel : view( = new JPanel())
    In view I have:
    JPanel toolbox to NORTH and JSplitPane: ds to CENTER.
    In ds I have:
    Left component: new JScrollPane(design) where design=new JPanel()
    Right component: JSplitPane(....) : called pe
    First problem:
    In ds the left component is too small. I tried to use all functions available , no result. I want the right component(pe) to have width=200, but no chance. It is too big. Why?
    Second problem:
    The scrolls are not appearing on the left at the ds(JSplitPane)
    Third problem:
    I add different components to design JPanel(the one which is placed into a JScrollPane which is related to the second problem) but nothing happens. They won't appear on design which is the same and without no scrolls.
    Please help me solve this Swing mistery.
    Thank you all.

    The split pane, by default, will size its two halves based on their preferred sizes. If the combined preferred sizes are too small (for the size of the spilt pane) then the extra space is distributed based on JSplitPane's resize weight. The default is to add the extra to the right hand side, see JSplitPane.setResizeWeight for an explanation. If you really want the right hand side to be exactly 200 pixels then you can programmatically move the divider to a location that would leave the right hand side to be 200. Or you can set the preferred size of the component you place there to 200 and set a resize weight that will give the extra space to the left instead of the right.
    I am not sure about why the scroll bars are not showing up. Does it need scroll bars?
    May I suggest creating a simple demo app to show the problem? Often I solve my own problems doing this otherwise you have some code for us to look at and play with.
    Ian

  • Problem with JSplitPane.setDividerPosition

    An applet has a split panel, a list of items shown to the left and a map display to the right.
    The problem I'm getting is that the divider bar insists on starting life in the middle.
    My intialisation looks like this:
        protected void initGui() {
            Container content = getContentPane();
            JMenuBar bar = new JMenuBar();
            setupMenu(bar, MK_MENU_DATASTORE, dataStoreMenu);
            setJMenuBar(bar);
            content.setBackground(new Color(0xfffeff));
            layerList = new JPanel();
            layerList.setLayout(new BoxLayout(layerList, BoxLayout.Y_AXIS));
            layerList.add(Box.createVerticalGlue());
            mapPanel = new ViewPanel();
            JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, layerList, mapPanel);
            split.setDividerLocation(ViewLayer.LAYERBOX_WIDTH);
            split.validate();
            content.add(split);
            validate();
        }Now the divider location I set seems to get squirreled away somewhere, because when I click the bar with the mouse it jumps to the correct position but it refused to initialise to the right position.

    Oops! Spotted it.

  • Problems resizing JSplitPane

    I have a JSplitPane with a Canvas3D on one side. It won't allow the split pane to be resized to make the canvas smaller. It will allow the splitpane to be resized to make the canvas larger, though.
    Is there a way to fix this?
    Thanks,
    Brian.

    The solution for this problem is a little bit tricky:
    - put a JScollPane (not a ScrollPane!) to one side of the JSplitPane and set the scrollbar policies to ..._SCROLLBAR_NEVER
    - put your Canvas3D into the ViewPort of the JScrollPane
    - create a PropertyChangeListener which listens to the JScrollPane and the JSplitPane
    Now you can use the JSplitPanes but it looks ugly because the size of the Canvas3D doesn't changes. So every time a PropertyChange event occures you have to calculate the size of the Canvas3D using your JFrame's size and the JSplitPanes diver location and change the Canvas3D's size using setSize().
    Oxygenic

  • KeyCode problem in JSplitPane

    Hi,
    I have a little problem with my swing application. My aplication is like this:
    A JFrame witch contains a JPanel witch contains a JSplitPane witch contains one left and one right element witch are both a JPanel with a JList with more elements in it. I used ActionMap and InputMap classes of the split to implement a TAB key action. The action was to give focus to one list at a time when the TAB key was pressed. That's fine so far, but when i tried to implement an action for the F76 key i got into problems. I used the same ActionMap-InputMap pair, but the listener isn't called, but instead it does exactly what the TAB key does:switching focus. I've noticed that there was exactly this action defined for that input map for F6. So i deleted it , but this strange thing still ocuurs. How can i force my application to do what i want on F6 and not what it wants? I don't know if this helps but: i'm using a RedHat 7.2 system (with the latest upgrades), and i didn't tested my application on other system, or other jdk than the one i'm curently using:1.3.1_01 .
    Please help.
    Thanks.

    I used the following code
    private void initMater() {
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception e) {}
    // after the look and feel is installed we override .....
    Object obj = new UIDefaults.LazyInputMap(new Object[] {
              "UP", "negativeIncrement",
              "DOWN", "positiveIncrement",
              "LEFT", "negativeIncrement",
              "RIGHT", "positiveIncrement",
              "KP_UP", "negativeIncrement",
              "KP_DOWN", "positiveIncrement",
              "KP_LEFT", "negativeIncrement",
              "KP_RIGHT", "positiveIncrement",
              "HOME", "selectMin",
              "END", "selectMax"
              // "F8", "startResize", NO !
              // "F6", "toggleFocus" NO !
    UIManager.put("SplitPane.ancestorInputMap",obj);

  • Problem of JSplitPane with ScrollPane

    Does JSplitPane work with ScrollPane?i am writing 2 ScrollPanes in a JSplitPane,but i can not move the bound.Thanks!

    It might be a little too late but I will put my 2 cents anyway...
    There is a scenario where mixing ScrollPane and JSplitPane is needed (unless you create your own AWTSplitPane): when you need to contain a heavyweight component (AWT) with a ScrollPane, you cannot use JScrollPane, that's for sure.
    The JSplitPane does not work because the minimumSize of the ScrollPane is set to its size and therefore JSplitPane won't reduce the component under its minimum size. The solution is to extend ScrollPane and override getMinimumSize method to whatever minimum size you decide.

  • JTree problem (inside JSplitpane)

    Hello All,
    I am trying to place a Jtree inside left side of jsplitpane. But it didn't appear in it and no error or exception thrown. For testing, i placed some other component like a panel inside that left pane of splitpane and it worked fine. For further testing, when I placed my jtree's panel in applet (to test whether it has something wrong with splitpane or some other thing), it didn't appear in it too. Below is the code to illustrate what I do for my last try (in applet):
    public class TRDB extends JApplet {
         public void init() {
              p("init() called");
         public void start() {
              p("start() called");
              //MainWindow mw = new MainWindow();
              //mw.setSize(400,450);
              //mw.setVisible(true);
              TreeViewPane mcp = new TreeViewPane();
              getContentPane().setLayout(null);
              getContentPane().add(mcp);
              mcp.setBounds(0,0,100,300);
              mcp.setBackground(Color.blue);
              p("start() finish!!!!!");
         private void p(String str) {
              System.out.println(str);
    // TreeViewPane class
    public class TreeViewPane extends JPanel {
         JTree tree;
         DefaultMutableTreeNode top;
         public TreeViewPane() {
              top = new DefaultMutableTreeNode("GDAMS");
             createNodes(top);
             tree = new JTree(top);
              tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
             //setOpaque(true);      //content panes must be opaque
         private void createNodes(DefaultMutableTreeNode top) {
             DefaultMutableTreeNode category = null;
             DefaultMutableTreeNode book = null;
             category = new DefaultMutableTreeNode("Books for Java Programmers");
             top.add(category);
             //...add more books for programmers...
             category = new DefaultMutableTreeNode("Books for Java Implementers");
             top.add(category);
    }Please have a look at see if something is wrong. I just saw a blue rectangular box (depicting my jtree panel) on applet without any table in it.
    Plz HELP!!

    I must take some coffee or strong cup of tea. i m exhaust, really. Yah i got it what i did wrong. sorry !!

  • A problem about JSplitPane

    I used a SplitPane to seperate a left tree and a right pane. And I draw geometry on the right pane.
    But when I drag the splitpane seperator, the graph on the right pane displays wrong position.
    How to resolve the problem? Can I add actionlister to the splitpane?

    the right pane displays wrong position
    what does it mean

  • JSplitPane probs

    Hiya,
    I have 2 problems with JSplitPane, here is a screenshot to help explain them:
    http://users.pandora.be/lunatic/javaprobs/splitpaneprob.JPG
    1) (top right red circle) I add a panel to a panel which is in the splitPane after it is created and shown. The added panel makes the minimum size of that side bigger. Only when I touch the devider it makes sure it is like that.
    Called validate on the added panel or the splitPane didn't work.
    2) (bottem red circle) I just want to see nothing there, but let that space still act like a devider, so it is like in most applications.

    Taking the buttons off the panes that you put in the splitter and place them on their own pane under the split pane would solve the problem of the unwanted splitter down between the buttons. Perhaps add the splitter pane to the CENTER of a border layout and the buttons in the SOUTH position.
    Your first problem is more puzzling. Have you tried to create a small sample that illustrates how to get that effect? Sometimes doing that reveals what the problem is other wise you can post it here and we can look at the actual code.
    Ian

  • MouseEvents not catching in JSplitpane

    Hi
    I had problem with JSplitpane, I used in my application for differentiation for two wave graphs, if i drag the splitpane (up/down)then my top and bottom graphs are updated accordingly, i want to write mouse listener and when moveRelesed update the two graphs.
    If i use property change listener for Splitpane it will work ok but the repainting is very slow(because every time), So i want to replace with mouse listener, but pressed on divider and dragged on it the event is not catching.
    please help

    You will ahve to add a mouse listener on the divider but not on the splitpane itself.
    The problem is the divider is implemented by the UI, so you will have to get it from the UI to add the mouse listener to it.
    Here is the principle :
              final JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT ,leftPanel, rightPanel);
              (((BasicSplitPaneUI)sp.getUI()).getDivider()).addMouseListener(new MouseAdapter() {
                   public void mouseReleased(MouseEvent e) {
                        System.out.println("Mouse released");
                        sp.getRightComponent().repaint();
                        sp.getLeftComponent().repaint();
              });(nb: I declare sp final to use it in the inner class)
    I hope this will help you,
    Denis

  • JSplitPane with AWT component

    Hi all,
    I have a problem with JSplitPane, I use it with JPanel as right component and an AWT component as left Component, so when I move The Divider of the JSplitPane it hides under the AWT component not on the top of it.
    I know that result from problem of heavy weight component and light weight component .. but my question is there any work arround I can do to make the Divider appear on the top of the AWT component??
    Thanks,

    You've been given an idea: DO NOT MIX AWT and SWING Components.
    Why do you need to mix them? What is the AWT component?
    If it's something you wrote yourself, then you can change it. If it's not, decompile it and change it. Anyone who can't provide a Swing version of their stuff at this point is out of business and shouldn't care what you do with it.
    If it's some Canvas subclass, you can make it a Swing component by changing 2 lines: extends JPanel instead of Canvas and change paint() to paintComponent().
    is there any work arround I can do to make the Divider appear on the
    top of the AWT component??definitely not, unless you make the divider a heavyweight component somehow.

  • JSplitPane problem with JTextArea

    The following piece of code has the problem in it. When you resize the splitpane you won't be able to decrease the size because of the setLineWrap(true).
    I am also wondering why the button in the bottom moves (and how do I stop it from moving) when the splitpane is made bigger.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    public class HMI extends JFrame {
         private JPanel map;
         private LeftMenu leftMenu;
         private JSplitPane split;
         public HMI(String title) {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                   SwingUtilities.updateComponentTreeUI(this);
              catch (Exception ex) {System.out.println("Look and feel does not exist");}
              map = new JPanel();
              leftMenu = new LeftMenu();
              split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,leftMenu,map);
              setLayout(new BorderLayout());
              add(split, BorderLayout.CENTER);
              split.setOneTouchExpandable(true);
              split.setBorder(BorderFactory.createEmptyBorder());
              setSize(1024,768);
              setLocationRelativeTo(null);
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
    //NESTED
    public class LeftMenu extends JTabbedPane {
         TabLogg logg;
         public LeftMenu() {
              logg = new TabLogg();
              addTab("Logg",null,logg,"Visar loggar av information f�r kartan");
    //NESTED
    public class TabLogg extends JPanel {
         private JButton reset = new JButton("Clear logg");
         private TitledBorder border = BorderFactory.createTitledBorder("Logg");
         private JTextArea text = new JTextArea();
         public TabLogg() {
              setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
              text.setLineWrap(true);
              text.setEditable(false);
              reset.setAlignmentX(Component.RIGHT_ALIGNMENT);
              add(text);
              add(reset);
              text.setText("testststg sd sdgs gsdg sd gs gsdgsdg");
         public static void main (String[] arg) {
              HMI human = new HMI("V�ltnavigeringssystem Interface - Ny");
    }

    I want the button to stay alligned to the very left. Read the Swing tutorial on [How to Use Box Layout|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html] for an explanation and example of how the alignment of components works.
    Also, use the following to maximize the frame:
    //setSize(1024,768);
    setExtendedState(JFrame.MAXIMIZED_BOTH);

  • JSplitPane problem with Border layout

    I am using Swing utilities.
    I have a JFrame
    I am using Panel with BorderLayout(mainPanel)
    To this Panel i am adding a Button Panel which comprises of two JButtons.
    Now i am creating a BorderedLayout Panel (subPanel)and setting its size and adding it to the mainPanel to its West side.
    Now my requirement is having the Split Panel with JTree on left side Panel and Canvas on the right side Panel
    So i created a JScrollPane with Canvas attached to it with Always Scrollable option set for the right hand side Panel.
    For the left hand side Panel, i created the JPanel with JTree attached to it.
    I have passed these two components as parameters to the JSplitPane with Horizontal Split and added the splitPane to the subPanel.
    Now i got the Split Pane with JTree on the left side Panel and Canvas on the right side panel.
    Now my requirement is getting the Text Area and Progress /Status bar below the Split Pane.So first made a JTextArea with BorderLayout and added it to the subPanel to
    its South.To this TextArea i added a progress bar to show the status to its East.
    Everything till here were working fine.
    Problem is while i am moving the split pnae to its right side (towards Canvas ) the Canvas is getting shifted beyond the subPanel.
    How to solve this problem
    I will be thankful to you if anyone could give me the solution ASAP

    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • Problem while changing the JSplitpane in a dynamic way.

    Hi Everyone,
    In my application i'm changing the jsplitpane in a dynamic way.i'm posting the sample code thatz giving problem.Kindly compile and execute this.In the first frame i've done a split of two parts. The top component has got the name of the application and the bottom component has got some links related to that application. If the user click on this link ,i'm capturing the bottom component alone from the original splitpane and i'm breaking that into another split.
    upto this every thing works fine.Now the problem is when ever the user click on that link it'z capturing that event and doing consecutive split on the bottom frame.But i need that paricular split that user has already got to be repainted for all the time when user click on the link.Eventhough i've captured the main splitpane object in some other variable and assiging the same to the second window when user click on that url.But itz not recognizing that.
    Kindly some one help me to resolve this.
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.GridBagLayout;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.util.Vector;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    public class Test2 extends JPanel // implements KeyListener
        static Vector<String> arrAppName = new Vector<String>();
        public static JSplitPane splitPane,splitPane2;
        public void AppWin(final JFrame frame)
            Container contentPane = this;
            GridBagLayout gb = new GridBagLayout();
            contentPane.setLayout(gb);
            arrAppName.add("link");
            JLabel lab = new JLabel("<html><font color=#6698FF><a href>" + arrAppName.get(0) + "</a></font></html>");
            contentPane.add(lab);
            JScrollPane listScrollPane = new JScrollPane(contentPane);
            JLabel label = new JLabel("APPLICATION REPORT", JLabel.CENTER);
            Font font = label.getFont();
            Font font3 = font.deriveFont(25.0f);
            label.setFont(font3);
            label.setFont(label.getFont().deriveFont(Font.ITALIC));
            label.setHorizontalAlignment(JLabel.CENTER);
            label.setForeground(new Color(0x736AFF));
            JScrollPane labelScrollPane = new JScrollPane(label);
            labelScrollPane.setVisible(true);
            // Create a split pane with the two scroll panes in it.
            splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
            splitPane.setTopComponent(labelScrollPane);
            splitPane.setBottomComponent(listScrollPane);
            splitPane.setDividerLocation(100);
            Dimension minimumSize = new Dimension(100, 50);
            listScrollPane.setMinimumSize(minimumSize);
            labelScrollPane.setMinimumSize(minimumSize);
              splitPane2= new JSplitPane();
              splitPane2=splitPane;
            lab.addMouseListener(new MouseListener()
                public void mouseClicked(MouseEvent arg0)
                    displayMainFrame("link", frame);
                public void mousePressed(MouseEvent arg0)
                public void mouseReleased(MouseEvent arg0)
                public void mouseEntered(MouseEvent arg0)
                public void mouseExited(MouseEvent arg0)
        public void buildWindow(String link, JFrame frame)
            Container contentPane = this;
            GridBagLayout gb = new GridBagLayout();
            contentPane.setLayout(gb);
            JLabel label = new JLabel("Next Screen", JLabel.CENTER);
            Font font = label.getFont();
            Font font3 = font.deriveFont(25.0f);
            label.setFont(font3);
            label.setFont(label.getFont().deriveFont(Font.ITALIC));
            label.setHorizontalAlignment(JLabel.CENTER);
            label.setForeground(new Color(0x736AFF));
            JScrollPane buildWindowtop = new JScrollPane(label);
            buildWindowtop.setVisible(true);
            contentPane.add(buildWindowtop);
           /*assigning the main split pane object for all the consecutive call*/
            splitPane=splitPane2;
            JSplitPane splitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
            splitPane1.setTopComponent(splitPane.getBottomComponent());
            splitPane1.setBottomComponent(contentPane);
            splitPane.setBottomComponent(splitPane1);
            splitPane.setOneTouchExpandable(true);
            splitPane.setDividerLocation(100);
            Dimension minimumSize = new Dimension(100, 50);
            buildWindowtop.setMinimumSize(minimumSize);
            splitPane1.setMinimumSize(minimumSize);
        } // end printing rows
        public static void displayFrame(String tname, JFrame framedisp, String buttonName, String tranCorrID,
            String buttonOption, JSplitPane buildSplit)
            Test2 mainDispPane = new Test2();
            framedisp.getContentPane().add(splitPane);
            framedisp.setVisible(true);
        public static void displayMainFrame(String link, JFrame framedisp)
            Test2 mainDispPane = new Test2();
            mainDispPane.buildWindow(link, framedisp);
            framedisp.getContentPane().add(splitPane);
            framedisp.setVisible(true);
        public static void main(String[] args)
            JFrame frame = new JFrame("MAIN WINDOW");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Test2 mainPane = new Test2();
            mainPane.AppWin(frame);
            frame.getContentPane().add(splitPane);
            frame.setSize(1280, 1000);
            frame.setVisible(true);
        } // end main
    } // end Test2Thanks in Advance,
    Siva.

    anybody can help me this regard?

Maybe you are looking for