Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Posts
    4
    Rep Power
    0

    Default Jtree link to JFrame Form

    Is there anyone can help me?

    I need to create a Jtree in the left hand side,then when I click the Jtree,it will display the related JFrame Form in right hand side..

    Need help urgently.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by daniel50096230 View Post
    Need help urgently.
    No one here write codes for you, so what you have try up to now?

  3. #3
    Join Date
    Sep 2008
    Posts
    4
    Rep Power
    0

    Default My codes

    Java Code:
    public class NewClass1 extends JFrame {
        CardLayout cl = new CardLayout();
        JPanel cardPanel = new JPanel(cl);
        JTree jt = new JTree();
         private JTree tree;
     
        public NewClass1() {
            
                 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	Container content = getContentPane();
    	JSplitPane jsp = new JSplitPane();
    	jsp.setDividerLocation(100);
    	content.add(jsp, BorderLayout.CENTER);
    	jsp.add(jt, JSplitPane.LEFT);
    	jsp.add(cardPanel, JSplitPane.RIGHT);
    
                setSize(1024,768);
    	show();
    
        
    
        }
    I had able to create two JSplitPane in left and right.But I am not able to link to JFrame Form when I click the left JSplitPane.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  5. #5
    Join Date
    Sep 2008
    Posts
    4
    Rep Power
    0

    Default Yes

    Yes,I would like to display my related GUI Form at the right based on my choice on the Tree....
    Last edited by daniel50096230; 09-16-2008 at 07:05 AM.

Similar Threads

  1. Move JTree item to another JTree.
    By Melki in forum AWT / Swing
    Replies: 8
    Last Post: 07-09-2009, 11:59 AM
  2. setting background color of JFrame form with NetBeans 6.1
    By onefootswill in forum New To Java
    Replies: 4
    Last Post: 08-12-2008, 07:02 AM
  3. Link for 64 bit JDK.
    By aparna in forum New To Java
    Replies: 0
    Last Post: 03-19-2008, 02:15 PM
  4. Unsatisfied Link Error
    By LudwigKarl in forum New To Java
    Replies: 0
    Last Post: 03-18-2008, 01:31 AM
  5. Link List
    By one198 in forum New To Java
    Replies: 0
    Last Post: 10-14-2007, 01:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •