This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyApplication { | |
private var current: Form? = null | |
private var theme: Resources? = null | |
fun init(context: Any) { | |
theme = UIManager.initFirstTheme("/theme") | |
Toolbar.setGlobalToolbar(true) | |
Log.bindCrashProtection(true) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyApplication { | |
private Form current; | |
private Resources theme; | |
public void init(Object context) { | |
theme = UIManager.initFirstTheme("/theme"); | |
Toolbar.setGlobalToolbar(true); | |
Log.bindCrashProtection(true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form hi = new Form("Round", new BorderLayout(BorderLayout.CENTER_BEHAVIOR_CENTER)); | |
Button ok = new Button("OK"); | |
Button cancel = new Button("Cancel"); | |
Label loginLabel = new Label("Login", "Container"); | |
loginLabel.getAllStyles().setAlignment(Component.CENTER); | |
Label passwordLabel = new Label("Password", "Container"); | |
passwordLabel.getAllStyles().setAlignment(Component.CENTER); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void showForm() { | |
final DefaultListModel<String> options = new DefaultListModel<>(); | |
AutoCompleteTextField ac = new AutoCompleteTextField(options) { | |
@Override | |
protected boolean filter(String text) { | |
if(text.length() == 0) { | |
return false; | |
} | |
String[] l = searchLocations(text); | |
if(l == null || l.length == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.codename1.test.bgfetch; | |
import com.codename1.background.BackgroundFetch; | |
import com.codename1.components.SpanLabel; | |
import com.codename1.ui.Display; | |
import com.codename1.ui.Form; | |
import com.codename1.ui.Dialog; | |
import com.codename1.ui.Label; | |
import com.codename1.ui.plaf.UIManager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Image duke = null; | |
try { | |
duke = Image.createImage("/duke.png"); | |
} catch(IOException err) { | |
Log.e(err); | |
} | |
int fiveMM = Display.getInstance().convertToPixels(5); | |
final Image finalDuke = duke.scaledWidth(fiveMM); | |
Toolbar.setGlobalToolbar(true); | |
Form hi = new Form("Search", BoxLayout.y()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form f = new Form("Accordion", new BorderLayout()); | |
Accordion accr = new Accordion(); | |
accr.addContent("Item1", new SpanLabel("The quick brown fox jumps over the lazy dog\n" | |
+ "The quick brown fox jumps over the lazy dog")); | |
accr.addContent("Item2", new SpanLabel("The quick brown fox jumps over the lazy dog\n" | |
+ "The quick brown fox jumps over the lazy dog\n " | |
+ "The quick brown fox jumps over the lazy dog\n " | |
+ "The quick brown fox jumps over the lazy dog\n " | |
+ "")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Image duke = null; | |
try { | |
// duke.png is just the default Codename One icon copied into place | |
duke = Image.createImage("/duke.png"); | |
} catch(IOException err) { | |
Log.e(err); | |
} | |
final Image finalDuke = duke; | |
Form hi = new Form("Shape Clip"); |