Home Java Example Java Swing Removing Horizontal Lines to Node Groups

Related Tutorials


 
 

Share on Google+Share on Google+

Removing Horizontal Lines to Node Groups

Advertisement
In this section, you will learn to create none type tree in Java. None type tree means that children nodes are not connected to their parent node

Removing Horizontal Lines to Node Groups

     

Introduction

In this section, you will learn to create none type tree in Java. None type tree means that children nodes are not connected to their parent node 

Program Description:

This program constructs a tree that does not   have any line or ruler to connect  parent and the child nodes. This is very simple, if you want to remove the connected line, just put the "None" property in the putClientProperty() method and you will get none type tree node. Finally, the tree is added to the frame. 

Here is the code of this program:

import javax.swing.*;
import javax.swing.event.*;

public class JTreeNone{

  public static void main(String[] args){
  JTree tree = new JTree();
  tree.putClientProperty("JTree.lineStyle""None");
  JScrollPane scrollpane = new JScrollPane(tree);
  JFrame fm = new JFrame("JTreeNone frame");
  fm.getContentPane().add(scrollpane, "Center");
  fm.setSize(300,300);
  fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  fm.setVisible(true);
  }
}

Download this program.

Output this program:

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: May 30, 2007

Related Tutorials

Discuss: Removing Horizontal Lines to Node Groups  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com