Solved

Graphic view of a Bookmarks file in an applet ???

Posted on 1998-02-10
12
244 Views
Last Modified: 2013-11-23
Hi, I made an applet (in Java 1.0.2) that read and displays contents of a Bookmarks file (text mode)in a TextArea, How can I view that Bookmarks file graphicly (and clickable) like in Windows95 (with folders, folders contents) with an applet?
I need the easiest way for this, please.

  Thanks in advance.

     Deladier.
0
Comment
Question by:Deladier
  • 7
  • 4
12 Comments
 
LVL 1

Accepted Solution

by:
froderik earned 50 total points
ID: 1232969
Hi,

One easy way is to use a predefined graphical component and I think that is what you are looking for. I would suggest that you take a look at the JTree class in the Java Foundation Classes. Try the follwing URL's for more information:
How to use trees:
http://java.sun.com/docs/books/tutorial/ui/swing/tree.html
Using the JFC/Swing packages:
http://java.sun.com/docs/books/tutorial/ui/swing/
JFC - documentation
http://java.sun.com/products/jfc/docs.html

Once you have a good tree component to use it should be quite easy to map the text version onto the graphics version depending
on your design.

Hope this helps

Fredrik
0
 

Author Comment

by:Deladier
ID: 1232970
I saw the URL's you gave me but and it seems interesting, this is new for me. I downloaded Swing 0.7 zip file, but how do I install it in my computer?, could you orient to me?. As I told you, I have JDK 1.0.2, but, will work suitably Swing 0.7 here?, because frankly I do not think to change of JDK version.

   Thank you.

0
 

Author Comment

by:Deladier
ID: 1232971
Adjusted points to 30
0
 
LVL 1

Expert Comment

by:froderik
ID: 1232972
I'm afraid I have mislead you somewhat. Swing in its current version only supports JDK 1.1.2 or higher. It might work anyway but it is not probable. I'm afraid that there is a general lack of high level graphical components for Java 1.0 around. But I haven't checked all possible sources. Perhaps there are a JAVA 1.0 compatible Tree somewhere. You would probably have to pay for it though. Implementing the tree yourself is probably quite too big a project but it is of course possible. I will look around for free trees and let you know if I find one.
0
 

Author Comment

by:Deladier
ID: 1232973
Ok, let us make this easier, just tell me how I can do this using vectors. A simple way to indicate folders, bookmarks, sons, right sons, position, contents, link with vectors. The idea is express a tree using vectors.

  Thanks.
0
 

Author Comment

by:Deladier
ID: 1232974
Adjusted points to 50
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:Deladier
ID: 1232975
I forgot, no graphics for this. Just a way to represent data in a tree with vectors.

  Thanks.
0
 
LVL 1

Expert Comment

by:froderik
ID: 1232976
Two ways:

Use an ordinary Vector with elements that is either another Vector (folder) or a leaf element (bookmark). When getting elements from the Vector you have to check which type it is and behave accordingly. If you want your bookmark data type to be more advanced than just an URL you should define a bookmark class.

Implement a tree data structure. This is a much nicer solution but requires some work. Use Vectors internally for data storage and use an interface for the elements. I could help you with the modelling part if you pick this solution.
0
 

Author Comment

by:Deladier
ID: 1232977
Ok, I'd like to use a tree data structure, could you please help me with modelling part, I'll thank you a lot.

   Thanks.

0
 
LVL 1

Expert Comment

by:froderik
ID: 1232978
public Tree implements TreeNode
{
  private Vector myElements;

  public addElement( TreeNode );
  public deleteElement( TreeNode );
  public TreeNode findElement( TreeNode );
  // Add whatever methods you would like here.
  // The implementation is most often just to
  // send a method to myElements.
}

public interface TreeNode
{
}

Do you get the idea?

If you are interested in sorting of the tree you would have to add some hash value method to TreeNode. And some insertSorted method to Tree.
0
 

Author Comment

by:Deladier
ID: 1232979
Clear like the crystal, thanks.

  Deladier.
0
 

Expert Comment

by:Kit_
ID: 3310955
It's for Deladier.


Hello.

I need to write an applet than must be able to read and modify Netscape's bookmarks. But I know that applet cannot get access to local files. Could you tell me,please, how you solved this problem?


Thanks!

Kit_
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
array220 challenge 8 46
base64 decode encode 12 96
Free Alternative to JIRA 4 55
eclipse compiler vs Installed JREs option 3 40
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now