Login Register






Need some serious java help filter_list
Author
Message
Need some serious java help #1
Well considering some of the best java programmers i know are on here, it doesn't hurt to ask!

I've had this problem for a 2 days and its really discouraging. Sad

I'm really new to JTree and its related classes, so sorry if this is mega easy!

I posted on SOF but alas, no help.
http://stackoverflow.com/questions/25131...jtextfield

Reply

RE: Need some serious java help #2
I don't think I clearly understand your problem Sir. But what appears to me is like this :-

You have a directory D with different subdirectories SD and you have files of different extension and you want to update the JTree when you search for files maintaining the directory hierarchy or structure ?

You said you want you edit the files. I think you would be able to get the location of the files and then add an action listener to them and open them in TextComponent.

You might have a look here :- http://stackoverflow.com/questions/16771...der-filter
http://www.java2s.com/Tutorial/Java/0240...kevent.htm

For dynamic Update

http://stackoverflow.com/questions/11671...ad-a-jtree

For fast string matching you can use Boyer Moore.

I haven't looked into your code properly since I still have doubt what kind of problem you're actually facing.
[Image: OilyCostlyEwe.gif]

Reply

RE: Need some serious java help #3
Posted an answer: https://stackoverflow.com/questions/2513...2#25169212
Try the solution and see if it works as expected.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Need some serious java help #4
(08-06-2014, 09:07 PM)Deque Wrote: Posted an answer: https://stackoverflow.com/questions/2513...2#25169212
Try the solution and see if it works as expected.

Hey, it works just as expected! It seems that I should've been more recursive about it. I went on to writing a filter method that instead of rebuilding the tree, just remove the nodes that didn't match criteria. However, I ran into a small problem there (didn't attempt to fix due to work).

Thanks Deque!

Reply