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("Border Layout", new BorderLayout()); | |
| ((BorderLayout)hi.getLayout()).setCenterBehavior(BorderLayout.CENTER_BEHAVIOR_CENTER); | |
| hi.add(BorderLayout.CENTER, new Label("Center")). | |
| add(BorderLayout.SOUTH, new Label("South")). | |
| add(BorderLayout.NORTH, new Label("North")). | |
| add(BorderLayout.EAST, new Label("East")). | |
| add(BorderLayout.WEST, new Label("West")); | |
| hi.show(); |
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("Border Layout", new BorderLayout()); | |
| hi.add(BorderLayout.CENTER, new Label("Center")). | |
| add(BorderLayout.SOUTH, new Label("South")). | |
| add(BorderLayout.NORTH, new Label("North")). | |
| add(BorderLayout.EAST, new Label("East")). | |
| add(BorderLayout.WEST, new Label("West")); | |
| hi.show(); |
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
| final Button show = new Button("Show Dialog"); | |
| final Button showPopup = new Button("Show Popup"); | |
| cnt.add(show).add(showPopup); | |
| show.addActionListener(new ActionListener() { | |
| public void actionPerformed(ActionEvent evt) { | |
| Dialog.show("Dialog Title", "This is the dialog body, it can contain anything...", "OK", "Cancel"); | |
| } | |
| }); | |
| showPopup.addActionListener(new ActionListener() { | |
| public void actionPerformed(ActionEvent evt) { |
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
| Dialog dlg = new Dialog("At Bottom"); | |
| dlg.setLayout(new BorderLayout()); | |
| // span label accepts the text and the UIID for the dialog body | |
| dlg.add(new SpanLabel("Dialog Body text", "DialogBody")); | |
| int h = Display.getInstance().getDisplayHeight(); | |
| dlg.setDisposeWhenPointerOutOfBounds(true); | |
| dlg.show(h /8 * 7, 0, 0, 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
| Dialog ip = new InfiniteProgress().showInifiniteBlocking(); | |
| // do some long operation here using invokeAndBlock or do something in a separate thread and callback later | |
| // when you are done just call | |
| ip.dispose(); |
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
| myContainer.add(new InfiniteProgress()); |
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
| Painter p = new Painter(cmp) { | |
| public void paint(Graphics g, Rectangle rect) { | |
| boolean antiAliased = g.isAntiAliased(); | |
| g.setAntiAliased(true); | |
| int r = Math.min(rect.getWidth(), rect.getHeight())/2; | |
| int x = rect.getX() + rect.getWidth()/2 - r; | |
| int y = rect.getY() + rect.getHeight()/2 - r; | |
| switch (style) { | |
| case CircleButtonStrokedDark: | |
| case CircleButtonStrokedLight: { |
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() { | |
| Form hi = new Form("Hi World"); | |
| hi.addComponent(new Label("Hi World")); | |
| Location loc = new Location(); | |
| loc.setLatitude(51.5033630); | |
| loc.setLongitude(-0.1276250); | |
| Geofence gf = new Geofence("test", loc, 100, 100000); | |
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 start() { | |
| if (current != null) { | |
| current.show(); | |
| return; | |
| } | |
| Form hi = new Form("Basic memory leakage test"); | |
| Container mainContainer = hi.getContentPane(); | |
| BorderLayout layout = new BorderLayout(); | |
| mainContainer.setLayout(layout); | |
| /*mainContainer.setScrollableX(false); |
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 pointerPressed(int x, int y) { | |
| addPoint(x-getParent().getAbsoluteX(), y-getParent().getAbsoluteY()); | |
| } |