• Post Reply Bookmark Topic Watch Topic
  • New Topic

SelectionListener prob  RSS feed

 
Ranganath Ranganaths
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody..

I have coded for the JTree to display the entire File System of a particular system.. but the problem is that.. i am not able to give a alert message using optionPane.messagedialog.. saying that if .. a floppy drive is not ready or cd isnt inserted into the cdromm... like that

2 .. secondly i wanted to know how to code for the selection Listener .. in the JTree... to get all the selected folder into the other half of the split pane


Please if i can solution to this prob i will be grateful.. coz i wil be finishing a project.. if any body knows please help me.. last time when i have posted for a different topic .. i didnt get any replies.. this time I hope to get a speedy reply........

thanking you
Ranganath.S
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I want to understand your problems before I try to help you solve them so that we don't waste time with me guessing.

1) Are you having problems displaying the message or are you having problems working out if the cdrom/floppy drive is ready?

2) Am i correct in assuming that you want to select the node in the left hand side of the split pane and have the expanded details of the ndoe displayed on the right hand side?

And in addition, we are all volunteers here, so some questions get answered and some don't. So you have to just be patient with us.

And last question. Did you have a specific reason for using a JTree and not a JFileChooser?

Cheers,
Rachel
 
Ranganath Ranganaths
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for some sort of replies..

first of all yes... I am very specific about the JTree.. as i have to follow my project srs..

secondly .. the problem is that i donnow how to check out if the drives are empty.. ie if the floppy drive is empty or cdrom is not ready as u said ... if the cdrom and floppy drive is ready or not..

"Am i correct in assuming that you want to select the node in the left hand side of the split pane and have the expanded details of the ndoe displayed on the right hand side?"--------> you are absolutely correct...(to be specific.. its like a windows explorer

Thanks a lot
Ranganth.S
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I'm going to have alook around for stuff and I'll get back to you asap.

Cheers,
Rachel
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I'm still looking for info an checking if the drive is ready. Out of interest, what happens now when you click on the node that shows the disk drive like the cdrom?

And then the tree...
So when the event is fired that a node was selected, you need to display the contents in the other half of the split pane.
You could try the TreeExpansionEvent and the TreeSelectionEvent. Then you could get the node that was selected (File object) and use the File object to list it's contents that you could then display on the other half of the split pane.

Try and see what you come up with and we'll take it from there.
Cheers
Rachel
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!