Posted by
Joachim Wesner on
Jul 18, 2009; 11:51am
URL: http://imagej.273.s1.nabble.com/GenericDialog-programmatic-OK-tp3691723p3691725.html
HI,
great, again another extremely quick and on the point response!!!!
I switched to the new version and imlemented Michaels suggestion, works
great!
Mit freundlichen Grüßen / Best regards
Joachim Wesner
Projektleiter Optik Technologiesysteme
Leica Microsystems CMS GmbH | GmbH mit Sitz in Wetzlar | Amtsgericht
Wetzlar HRB 2432
Geschäftsführer: Dr. Stefan Traeger | Dr. Wolf-Otto Reuter | Dr. David Roy
Martyr | Colin Davis
www.leica-microsystems.com
Wayne Rasband
<
[hidden email]>
Gesendet von: An
ImageJ Interest
[hidden email]
Group Kopie
<
[hidden email].
GOV> Thema
Re: GenericDialog programmatic
"OK" ?
17.07.2009 23:25
Bitte antworten
an
ImageJ Interest
Group
<
[hidden email].
GOV>
The v1.43d daily build adds a getButtons() method to the GenericDialog
class. This is what it looks like:
/** Returns references to the "OK" ("Yes"), "Cancel",
and if present, "No" buttons as an array. */
public Button[] getButtons() {
Button[] buttons = new Button[3];
buttons[0] = okay;
buttons[1] = cancel;
buttons[2] = no;
return buttons;
}
The daily build also allows you to drag images, text files (.txt,
.java, .js) and plugins (.jar, .class) from a browser window and drop
them on the ImageJ window. Images and text files are displayed and
plugins are installed.
-wayne
On Jul 17, 2009, at 14:31, Michael Schmid wrote:
>
> Hi Joachim,
>
> you could call gd.actionPerformed with a new ActionEvent that has the
> OK button as a source. The problem: there is no GenericDialog method
> that returns a reference to this button.
>
> It would be great to have GenericDialog function that returns the
> list of Buttons (this would be helpful also for other purposes, e.g.,
> enabling/disabling/changing a Button label).
> Otherwise, you have to step through the components of gd.getComponents
> () to find the panel with the buttons and then step through its
> getComponents() to find the OK button.
>
> Michael
>
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit
http://www.messagelabs.com/email
______________________________________________________________________