codenameone

Form with the VKB always open

巧了我就是萌 提交于 2020-01-23 17:27:07
问题 For a Form used for chatting, it could be nicer to have the VKB always opened (like in other chatting apps), because opening and closing the VKB after every message is annoying. How can I achieve that with Codename One? I'm interest for that in a single Form only, in the other Forms the VKB should act normally. Thank you 回答1: We minimize the keyboard when you click "done", back (on Android) or when you click on a different component to move focus away. This is pretty consistent with the way

onTop side menu in the rightmost side of the app

廉价感情. 提交于 2020-01-23 12:48:10
问题 By default, Codename One onTop side menu is on the left of the title area. Is it possible to have it on the right instead? Command services = new Command(" Services", servicesIcon) { @Override public void actionPerformed(ActionEvent evt) { } }; f.getToolbar().addCommandToSideMenu(services); 回答1: Currently we don't support putting the side menu on the right side of the UI I think there is an RFE on that but I'm not sure. It's something we need to have for RTL/bidi (Right to left languages)

Investigate Java.Lang.NullPointerException on a Codename One iOS app

﹥>﹥吖頭↗ 提交于 2020-01-23 12:36:24
问题 Today I tried to investigate this issue: https://github.com/codenameone/CodenameOne/issues/2975 I'm writing here to ask how I can find exactly what goes wrong. This bug is frustrating. Basically, on iOS only, I have this error, that happens after some random app usage: java.lang.NullPointerException at com_codename1_ui_Form.pointerReleased:3758 at net_informaticalibera_cn1_simpleapi_OuterForm.pointerReleased:360 at com_codename1_ui_Component.pointerReleased:4679 at com_codename1_ui_Display

Re textArea growByLimit issues in layerLayout

 ̄綄美尐妖づ 提交于 2020-01-23 03:35:08
问题 I set the textArea setGrowByContent true and setGrowLimit to 2, but there is always only one row. So i twisted the code and increase the height of textArea by twice if the size of textArea is greater than Button size. Below is the codes. My issue is at the end of the question: Button homeButtonn = new Button(btnIcon){ @Override protected Dimension calcPreferredSize() { System.out.println("Button size: " + super.calcPreferredSize()); return super.calcPreferredSize(); } @Override public void

How to get an event for every change in a CodenameOne TextField

倖福魔咒の 提交于 2020-01-23 01:34:10
问题 I am building an app using CodenameOne and want to use a TextField to filter a long list of items. I tried using a DataChangedListener, as proposed in https://www.codenameone.com/javadoc/com/codename1/ui/TextField.html, but this will only fire an event after the user completes editting (i.e. presses the 'enter' key). How can I get an event for each character changed in the text field? 回答1: DataChangedListener does fire for every key input and not when Enter key is pressed (this is for

How can i update my codenameone plugin and handed to the latest classes update

核能气质少年 提交于 2020-01-17 03:51:05
问题 I update the codenameone frequently but I have a problem I don't have some classes or functions for example I have only three classes in com.codename1.ui.geom such as: Dimension , Point and Rectangle classes but not the others or in graphics.class I don't have function named setTransform . what should I do? Thanks in advance. Updated: 回答1: Right click the project select project properties and client Update Client Libs button: 来源: https://stackoverflow.com/questions/24993130/how-can-i-update

Codename One — action event

混江龙づ霸主 提交于 2020-01-17 01:22:06
问题 In a Codename One project, say project "PRJ1" i created on NetBeans, I defined a file that i shouldn't have as an Action event. Specifically, in the designer interface to edit "theme.res" (I'm using the latest version of NetBeans & Codename One), I right-clicked a button, then in the drop-down menu Events -> Action event, entered a .jar file. Ever since, i'm getting the error: Error opening Netbeans.java.IOException: Cannot run program "..\MyApp.jar" CreateProcess error=193, %1 is not a valid

How do I get device related info programmatically like model number or IMSI , MSISDN while developing codenameone app

大城市里の小女人 提交于 2020-01-16 17:35:27
问题 I am developing a codename app and need to capture device model ,imsi and msisdn information so that i can send data depending on this information. 回答1: Try Display.getInstance().getUdid() and Display.getInstance().getMsisdn() you can also use Display.getInstance().getProperty(...) for more properties. 来源: https://stackoverflow.com/questions/25226797/how-do-i-get-device-related-info-programmatically-like-model-number-or-imsi-ms

catching unknown host exception in codename one

为君一笑 提交于 2020-01-15 08:57:08
问题 I am building an app using codename one So the thing is, I need to access a URL using the app. THe URL brings back some result which I show on the screen. SO I use these lines to do that : ConnectionRequest c = new ConnectionRequest() { protected void readResponse(InputStream input) throws IOException { ByteArrayOutputStream bs = new ByteArrayOutputStream(); int ch; while ((ch = input.read()) != -1) { bs.write(ch); } serverOutput = new String(bs.toByteArray()); bs.close(); } }; c.setUrl("My

Drawing a custom component

﹥>﹥吖頭↗ 提交于 2020-01-15 05:33:08
问题 This is kind of 2 questions: 1) Is the overriding the paint member of a Component the best approach for a simple 2D graphics game using codename one? Or should I not even be attempting it?? 2) Why does the code below draw my Component only to erase it instantly? I initialise my component like this: protected void StartGame() { final Component newC = new PaintedComponent(); Container mv = findContainerMainVisual(); mv.addComponent(newC); mv.setShouldCalcPreferredSize(true); mv.animateLayout