MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / create

Method create

CodenameOne/src/com/codename1/ui/Command.java:122–131  ·  view source on GitHub ↗
(String name, Image icon, final ActionListener ev)

Source from the content-addressed store, hash-verified

120 ///
121 /// a newly created Command instance
122 public static Command create(String name, Image icon, final ActionListener ev) {
123 Command cmd = new Command(name) {
124 @Override
125 public void actionPerformed(ActionEvent evt) {
126 ev.actionPerformed(evt);
127 }
128 };
129 cmd.setIcon(icon);
130 return cmd;
131 }
132
133 /// Creates a new command instance that encapsulates the action listener and details, the main
134 /// value of this approach is in our ability to write commands using the shorthand lambda syntax

Calls 1

setIconMethod · 0.95