messages
argument specifies the array of messages which will be shown in the dialog, organized in a vertical grid.
public class AnalyzeImageAction extends AbstractMDIAction { public AnalyzeImageAction(MDIApplication appli, String name) { super(appli, name); this.setDescription("Analyze", "Analyze Image"); } @Override public void run() throws Exception { GUIApplication gui = ((GUIApplication) app); BufferedImage image = (BufferedImage) gui.getSelectedProperties().getObject(); gui.showMessageDialog("Size", MDIDialogBuilder.INFORMATION_MESSAGE, "Width: " + image.getWidth(), "Height: " + image.getHeight()); } }with the following result:
MDIMessageDialogHelper
:public class AnalyzeImageAction extends AbstractMDIAction { public AnalyzeImageAction(MDIApplication appli, String name) { super(appli, name); this.setDescription("Analyze", "Analyze Image"); } @Override public void run() throws Exception { GUIApplication gui = ((GUIApplication) app); BufferedImage image = (BufferedImage) gui.getSelectedProperties().getObject(); MDIMessageDialogHelper.showMessageDialog("Size", MDIDialogBuilder.INFORMATION_MESSAGE, "Width: " + image.getWidth(), "Height: " + image.getHeight()); } }with the following result:
Copyright 2006-2023 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences