Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created February 15, 2016 12:08
Show Gist options
  • Save codenameone/d1db2033981c835fb925 to your computer and use it in GitHub Desktop.
Save codenameone/d1db2033981c835fb925 to your computer and use it in GitHub Desktop.
Simple usage of the InteractionDialog class in Codename One
InteractionDialog dlg = new InteractionDialog("Hello");
dlg.setLayout(new BorderLayout());
dlg.add(BorderLayout.CENTER, new Label("Hello Dialog"));
Button close = new Button("Close");
close.addActionListener((ee) -> dlg.dispose());
dlg.addComponent(BorderLayout.SOUTH, close);
Dimension pre = dlg.getContentPane().getPreferredSize();
dlg.show(0, 0, Display.getInstance().getDisplayWidth() - (pre.getWidth() + pre.getWidth() / 6), 0);
@codenameone
Copy link
Author

Sample usage of InteractionDialog.

From the Codename One project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment