6 comments
Comment actions Permalink

Implementing Configurable Interface and overriding some methods seems to be the solution.

0
Comment actions Permalink

You can find an example project in samples/applicationConfigurable

0
Comment actions Permalink

I have another problem. I'm trying ot use JFileChooser to choose a file and place it in the JTextField, but the isModified method gets called way too early. Somehow the method is called by the fileChooser.showOpenDialog(new JFrame()), which is really unexpected.
I need the isModified method to be called after the file is chosen, not when the dialog is opened. Right now the change is not detected, because my isModified method checks the JTextField for changes, but ofcourse, there are none while opening the dialog. The weirdest part is that the isModified method is accessed by the same Thread which opens the dialog, which means synchronization is ignored. myMethod() -> fileChooser.showOpenDialog(new JFrame()) -> ? -> isModified() -> myMethod(). Is this behaviour intentional?

I Actually have no problem that it accesses the isModified method, but is there a way for me to manually notify something after I update the JTextField, that something has changed?

0
Comment actions Permalink

Don't do that. Use the TextFieldWithBrowseButton component instead.

Also note that the isModified() method will be called repeatedly while the dialog is open. It's correct that the first call of the method will occur before the user has made any changes.

0
Comment actions Permalink

Thanks, I'll look into that.

0
Comment actions Permalink

I was using wrong component for parent, that was the problem.

0

Please sign in to leave a comment.