Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


java tree without using swing

Posted on 1999-07-18
Medium Priority
Last Modified: 2013-12-29

I need some help in writing a tree for an awt applet interface that does not use the swing classes.  I need it to work on browsers that do not yet support the swing classes. Does anyone have anything similar to the swing jtree ?
It has to generate an event on expanding and colapsing the nodes.

Question by:meself
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1

Author Comment

ID: 1246380
Edited text of question.

Author Comment

ID: 1246381
Edited text of question.
LVL 16

Expert Comment

ID: 1246382
I have seen several Tree widget implementations on the web.
make a search at

or you can always write your own.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

florinsuciu earned 400 total points
ID: 1246383
You can construct your TreeView structure which can contain TreeNodes
//****TreeNode class********
 public TreeNode(String text, Image collapsedImage, Image expandedImage)
        depth = -1;
        isExpanded = false;
        this.text = text;
        sibling = null;
        child = null;
        this.collapsedImage = collapsedImage;
        this.expandedImage = expandedImage;
        numberOfChildren = 0;
  }//Cna write your expand and colapse methods
  public void expand()
        if (isExpandable())
            isExpanded = true;
 public void collapse()
        isExpanded = false;
//*****TreeView class****************
You must have a methods for drawing your node and ToolTip
 Also the events MouseMove
    void treeView1_MouseMove(Event event){
//A method for add a newNode, something like that:
 public void append(TreeNode newNode, boolean expand)
 public int getCount()//for count the TreeNode
        return count;
The Html must contain a lot of parameters something like that :
<PARAM NAME1='Name1' VALUE='Boolean value'>
<PARAM NAME2='Name1' VALUE='Boolean value'>
<PARAM NAME3='Name2' VALUE='Boolean value'>
<PARAM NAMEn='Namen' VALUE='Boolean value'>
//and for TreeView structure i.e.
<PARAM NAME='I0' VALUE=' Caption;URL;Target-Frame;deph;image_for_folder;image_for_expanded ;image_for_collapsed ;Status-Bar >
<PARAM NAME='I1' VALUE=' Caption1;URL1;Target-Frame1;deph1;image_for_folder1;image_for_expanded1 ;image_for_collapsed1 ;Status-Bar1 >
<PARAM NAME='In' VALUE=' Caption;URL;Target-Frame;deph;image_for_folder;image_for_expanded ;image_for_collapsed ;Status-Bar >

The applet get those parameters and work it.
Good lock!

LVL 16

Expert Comment

ID: 1246386
so who will implement the actual rendering ? :)

Expert Comment

ID: 1246387

Expert Comment

ID: 6829070
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.
Thank you,
Moderator @ Experts Exchange

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question