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

x
?
Solved

java tree without using swing

Posted on 1999-07-18
10
Medium Priority
?
254 Views
Last Modified: 2013-12-29
Hi,

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.

thanks
0
Comment
Question by:meself
[X]
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
10 Comments
 

Author Comment

by:meself
ID: 1246380
Edited text of question.
0
 

Author Comment

by:meself
ID: 1246381
Edited text of question.
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1246382
I have seen several Tree widget implementations on the web.
make a search at
www.javashareware.com
www.jars.com
www.gamelan.com

or you can always write your own.
0
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!

 
LVL 2

Accepted Solution

by:
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 >
.........................
//etc.
.........................
<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!

0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1246386
florinsuciu:
so who will implement the actual rendering ? :)
0
 
LVL 2

Expert Comment

by:florinsuciu
ID: 1246387
heyhey:
Me!
0
 
LVL 1

Expert Comment

by:Moondancer
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.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

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