codenameone

Slider doesn't draw (CodeName One) with Windows phone skin

喜你入骨 提交于 2019-12-11 16:47:02
问题 I am trying to create a slider in codename one, but for some reason the slider isn't drawn, other components however, are. The code I have so far public void start() { if (current != null) { current.show(); return; } mainForm = new Form("Slider and buttons"); c = mainForm.getContentPane(); c.setLayout(new FlowLayout()); Slider jSlider = new Slider(); jSlider.setMaxValue(360); jSlider.setMinValue(0); jSlider.setProgress(50); jSlider.setEditable(true); jSlider.setPreferredSize(new Dimension(300

Codenameone: access sqlite outside application dir/database

左心房为你撑大大i 提交于 2019-12-11 14:06:43
问题 How can i Access a SQLite DB which exists outside the application/database dir? Looks like openOrCreate alway point to the appdir/database 回答1: You can only use getDatabasePath to get the path for the DB and assuming it is not null copy the file into the given location. The reasoning is that database might not be SQLite so it won't necessarily consist of one file. There is also the issue of filesystem which isn't very portable between platforms. 来源: https://stackoverflow.com/questions

Working With A Codename One Project In Git/SVN version control

谁说我不能喝 提交于 2019-12-11 11:46:29
问题 We are trying to work on a Codename One project using git version control. When I pull the project from git, the files (modified and newly added theme res files) are updated but they don't appear in the theme. My changes aren't reflected when I try to run the project, how to refresh the project? I tried to build/clean, refresh the cn1lib too but made no progress. 回答1: Thankyou shai, i uncheck the xml team mode but that doesnt make any difference.. you gave the link (https://www.codenameone

How to load an external url in Codename One WebBrowser component?

浪尽此生 提交于 2019-12-11 09:43:33
问题 Can anyone help me? I've got an App in development and a core feature is to load a third party webpage (URL) that has css and javascript in the Codename One WebBrowser component. My questions are:- 1. How do I load the url? 2. Is it possible to interact with the javascript on this url like alerts and confirms? 3. How to switch between Device default browser etc? Thanks. 回答1: A native WebBrowser component is laid out a-synchronously which means its preferred size is calculated later and so the

How do you get ActionBar from SocialBoo theme to show up in your GUI?

半腔热情 提交于 2019-12-11 08:24:45
问题 Ok. Starting over with this. I see that the SocialBoo theme has something similar in what I want to achieve. If I find that I can work and improve. I Added a new socialboo theme and created blank GUI. Assumed it would be a Commandbehavior but that didnt do the trick, so did adding tabs . Seems like those components are not for that specific bar... However did notice another issue. How do I get the social actionbar as displayed in the socialboo theme ? (Screen shot). Assuming those images etc

Components inside List in CodenameOne

£可爱£侵袭症+ 提交于 2019-12-11 07:49:54
问题 my question is. Is possible to add a component like a button (button has a functionality that triggered when it is clicked) inside a list component? This image explain better what I refer: http://2.bp.blogspot.com/-HThpKcgDyRA/URI_FdpffMI/AAAAAAAAAUI/SficZAPXaCw/s1600/1.png 回答1: Yes but it requires some handcoding and it will only work for touch (since you won't be able to assign focus to it). We normally recommend just using Component/Container hierarchies for these cases rather than dealing

Codename One Storage and FileSystemStorage space occupied, available space, list of files and clearing

雨燕双飞 提交于 2019-12-11 05:35:45
问题 Inside a Codename One app, I need an area (for developers and testers) that shows: how much space is occupied by the Storage + FileSystemStorage; the available space (useful also to alert the user if there isn't enough space to record videos or to take photos); the list of saved files inside Storage + FileSystemStorage; an option to reset the app, clearing both Storage and FileSystemStorage. In the Codename One API, I found Storage.getInstance().clearCache and Storage.getInstance()

Proper way of using LocationManager in Codename one

主宰稳场 提交于 2019-12-11 04:25:20
问题 I am using the LocationManager to trace a user's location and show the same on GoogleMaps. I am using the following approach and have some questions regarding the same. To get the user's location for the first time, I am using: locationManager = LocationManager.getLocationManager(); location = locationManager.getCurrentLocation(); What I understand that this is a blocking call. Hence, I show an infinite progress bar till this method returns. Once I have the location, I call a jsp page hosted

How to bundle sounds with Codename One?

蓝咒 提交于 2019-12-11 00:47:42
问题 I want to include sounds in my Codename One app for effects like clicking a button, transitions, etc. I prefer not to download them from URL, since they are very small and I want them to be played even when the device is not connected to the internet. It looks like I cannot include the source files in the theme. What should I do? 回答1: Put the sound file in the "src" folder inside your project folder and reference it like below: private Media MEDIA = null; public void playAudio(String fileName

How to pass control from GUI created form to code created form in codenameONe

亡梦爱人 提交于 2019-12-11 00:36:40
问题 I have created a form using GUI builder and another form via code which loads the google map. There is a button in the form which was created by using GUI builder, I need to go to the map while clicking the button. How to do it ? please help. 回答1: Add an actionListener to your button and call the new form in the method generated in StateMachine. Your form should be created in StateMachine. For example: protected void onPage2_ButtonAction(Component c, ActionEvent event) { Form hi = new