• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFileChooser

 
Jerry Simmers
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JFileChooser in Motif and I have encountered a puzzling problem. When in Motif, the openDialog contains an "Update" button in addition to the usual "Approve" and "Cancel" buttons. I'm looking for a way to change the behavior of this "Update" button, or better yet...just delete the button from the dialog. I can't seem to find anything anywhere in the javadocs on how to do such a thing. As a matter of fact, I can't find much reading material at all regarding this "Update" button. Any ideas???
 
Yogesh Kodgule
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a vague idea how to do that, but I am sure it (the following) works.... try with some manipulations and let me know..

Use the method:
getComponents() of java.awt.Container for the file chooser u r using.
=======================================================================
public Component[] getComponents()Gets all the components in this container.

Returns:
an array of all the components in this container.
=======================================================================

Now here you will get all the components and you can address the exact one, which you want to modify. Do your manipulation and update the FileChooser.

Try it out, hope it may help you, nd let me know ....if it works .!!

Yogesh Kodgule
"Thinking of doing something is also doing something ...so don't just stop thinking!"
 
Jerry Simmers
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well...I can maybe see getting the array of components, but do you think java will actually allow me to remove a native component from the motif filechooser???

For instance, I get the array of components, but since the filechooser is in my case a MotifFileChooser created automatically at the detection of being on a motif system, will I actually be able to go deep enough and perform manipulations on that filechooser.
 
Yogesh Kodgule
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U r just making an instance of a filechooser. JVM itself takes care of doing the in depth manipulations as it by itself dtermines what kind of OS u r working on and gets an instance of that systems's file chooser for you. Just what you need to do is use the java methods to access the component you wan't to manipulate. Then modify the component and replace it or say in your case remove it.

So I think it is possible to do that.
Offcourse ... the Swings experts here can correct me if i m wrong.

So let me know the result.


[ June 25, 2004: Message edited by: Yogesh Kodgule ]
 
Yogesh Kodgule
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does that worked?
:roll:
Yogesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!