J2ME GUI实战之八 ----------LWUIT的List控件

自动驾驶世界模型:构建可推演的因果引擎 世界模型是自动驾驶系统从感知驱动迈向认知驱动的关键范式,其本质并非高保真视频生成,而是对交通环境动态与物理约束的因果压缩建模。它通过在低维潜在空间(latent space)中编码车辆、行人、道路及规则间的隐式依赖关系,实现轻量、稳定、可微分的状态推演。技术价值在于打破传统‘检测-跟踪-预测-规划’链式误差累积,提升紧急响应速度与corner case鲁棒性。典型应用场景包括高速跟车临界决策、无保护左转风险预判、雨雾遮挡下的鬼探头应对等。本文聚焦SSM架构的世界模型落地实践,融合MBRL规划与3DGS空间记 阅读详情
本文来自:http://blog.youkuaiyun.com/hellogv/ ,转载必须注明出处!
首先先给出本例的效果图:


    List在LWUIT中,可以有Button 与 BoxLayout-Y 取代,当然是在列项不多的时候。当列项多时,那就是LIST更省资源了!LWUIT的List比原List更强大,可以在LIST中实现一行存在多列的效果,并且背景还可以设置,不得不赞一下!
    以下给出List最简单的使用代码:
  1. /*
  2.  * Copyright ?2008 Sun Microsystems, Inc. All rights reserved.
  3.  * Use is subject to license terms.
  4.  *
  5.  */
  6. package com.sun.lwuit.uidemo;
  7. import com.sun.lwuit.Button;
  8. import com.sun.lwuit.Command;
  9. import com.sun.lwuit.Dialog;
  10. import com.sun.lwuit.Form;
  11. import com.sun.lwuit.List;
  12. import com.sun.lwuit.events.ActionEvent;
  13. import com.sun.lwuit.events.ActionListener;
  14. import com.sun.lwuit.layouts.BorderLayout;
  15. import com.sun.lwuit.list.DefaultListModel;
  16. /**
  17.  *本例演示如何使用List控件
  18.  */
  19. public class ListDemo implements ActionListener  {
  20.     public Form form = new Form("ListDemo");
  21.     private  Command backCommand = new Command("Back", 1);
  22.     private String[] str_list = {
  23.     "aaaaaaaaaaaa",
  24.     "bbbbbbbbbbbb",
  25.     "ccccccccccccc",
  26.     "ddddddddddddd"
  27.     };
  28.     ListDemo(){
  29.         form.setLayout(new BorderLayout());
  30.         form.addCommand(backCommand);
  31.         form.setScrollable(true);
  32.         //列表控件,尽管列表控件占用不少面积,但实际上跟普通的Componet一样
  33.         DefaultListModel myListModel = new DefaultListModel(str_list);
  34.         List list = new List(myListModel);
  35.         list.getStyle().setBgTransparency(100);
  36.         //按钮控件
  37.         Button button = new Button("test");
  38.         form.addComponent(BorderLayout.CENTER,list);
  39.         form.addComponent(BorderLayout.NORTH,button);
  40.         list.addActionListener(this);
  41.         form.setCommandListener(this);
  42.     }
  43.     public void actionPerformed(ActionEvent arg0) {
  44.            
  45.         try{//处理列表事件
  46.             String str=((List)(arg0.getSource())).getSelectedItem().toString();
  47.             Dialog.show("ListDemo", str, "OK", null);
  48.         }catch(Exception e)//处理COMMAND事件
  49.         {
  50.             Command command=arg0.getCommand();
  51.             if(command==backCommand)
  52.                 UIDemoMIDlet.backToMainMenu();
  53.         }
  54.     }
  55. }

J2me-listJ2me-list package com.software.test; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.List; import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; public class ListMIDlet extends MIDlet implements CommandListener { private Display display; private List list; private Command getCmd; public ListMIDlet() { display = Display.getDisplay(this); list = new List("List title", List.MULTIPLE); getCmd = new Command("Get", Command.SCREEN, 1); } protected void destroyApp(boolean arg0) throws MIDletStateChangeException { } protected void pauseApp() { 立即下载

相关推荐

淘特App x-sign参数逆向实战:从抓包到算法定位

本文详细解析了淘特App的x-sign参数逆向过程,从抓包分析到算法定位,涵盖了使用jadx-gui进行静态分析、Frida动态Hook验证以及Native层算法还原等关键技术。文章重点介绍了x-sign参数的生成机制及其在阿里系应用中的安全防护策略,为逆向工程师提供了实用的调试技巧和对抗策略。

5b6n7m8的博客 229

用GUI做一个下拉列表吧,LVGL『Drop-down list下拉列表控件』介绍

一. LVGL GUI下拉列表控件的概念 下拉列表允许用户从列表中选择一个值。下拉列表默认情况下处于关闭状态,并显示单个值或预定义的文本。激活后(通过单击下拉列表),将创建一个列表,用户可以从中选择一个选项。当用户选择新值时,该列表将被删除。 二. LVGL GUI下拉列表小部件和样式 调用下拉列表的主要部分, LV_DROPDOWN_PART_MAIN 它是一个简单的 lv_obj 对象。它使用所有典型的背景属性。按下,聚焦,编辑等阶梯也照常应用。 单击主对象时创建的列表是 Page。它的背景部分可

朝气蓬勃 7658

如何在离线的电脑上部署一个本地Deepseek(使用ollama)

例如,如果您的显卡显存为 16GB,官方推荐使用 32b 大小的 DeepSeek 模型。请根据您的硬件配置选择适合的模型版本,以获得最佳性能。首先我们需要将ollama和chatbox的安装包,Deepseek模型文件通过U盘或者光盘的形式导入到这台不能联网的电脑上。按照时间排序,找到最大的那个文件,就是gguf格式的模型,复制出来,改名为qwen2.5-coder0.5b.gguf。:基于开源模型(如 QWEN 和 LLAMA)微调,参数量从 1.5B 到 70B 不等,适合本地硬件部署。

qq_41854911的博客 1万+

GUI怎么能缺少列表, LVGL『List列表控件』介绍

一. LVGL GUI列表控件的概念 列表是从背景页面和其上的按钮构建的。按钮包含一个可选的类似图标的图像(也可以是一个符号)和一个 Label。当列表足够长时,可以滚动它。 二. LVGL GUI列表小部件和样式 列表与页面具有相同的部分 LV_LIST_PART_BG LV_LIST_PART_SCRL LV_LIST_PART_SCRLBAR LV_LIST_PART_EDGE_FLASH 有关详细信息,请参见页面文档。 列表上的按钮被视为普通按钮,它们只有一个主要部分称为 LV_BTN

朝气蓬勃 8609

反向代理的隐形陷阱:为何你的HTTPS请求会降级为HTTP?

本文深入探讨了Nginx反向代理中HTTPS降级为HTTP的隐形陷阱及其安全风险,分析了五大降级诱因,包括协议信息丢失、重定向配置错误等,并提供了完整的防御性配置方案和实战指南,帮助开发者确保Web应用的安全性。

kotlin6android的博客 453

Python与西门子PLC数据交互实战:基于Snap7的跨平台工业通信指南

本文详细介绍了如何使用Python和Snap7库实现与西门子PLC的数据交互。内容涵盖跨平台环境搭建、连接参数配置、数据读写实战及性能优化技巧,为工业自动化、数据采集和智能制造场景提供了一套轻量、灵活且高效的通信解决方案。

vim8coder的博客 292

j2me中List组件

 List(String title,int listType) List(String title,int listType,String[] StringElements,Image[] imageElements)上面是List的两个构造函数,第一个参数是标题,第二个参数是列表的类型,有三种:Choice.EXCLUSIVE,Choice.MULIPLE,Choice.IMP

zzxiaoma的专栏 708

模拟IC设计避坑:手把手教你用Cadence仿真恒定跨导轨到轨运放(附完整工艺库文件)

本文详细解析了使用Cadence仿真恒定跨导轨到轨运放的全流程,涵盖电路原理、工艺库配置、尺寸设计及仿真分析。通过1:3电流镜补偿技术实现跨导稳定,提供CSMC 0.25um工艺下的实战案例,帮助工程师规避设计陷阱,提升模拟IC设计效率。

weixin_30952535的博客 500

通过J2ME的录音功能实现简易示波器

通过J2ME的录音功能实现简易示波器

hellogv的专栏 1万+

5.3 磁悬浮轴承:基于有限元法的电磁场分析

摘要:本文系统阐述了有限元法在磁悬浮轴承电磁场分析中的应用。相较于等效磁路法和解析法,有限元法能精确处理复杂几何、材料非线性和动态效应。重点介绍了三维静磁场仿真(用于计算稳态磁场、电磁力和电感)和瞬态磁场仿真(用于分析动态过程和损耗)的关键设置与后处理方法。通过有限元分析可验证承载力、评估损耗分布并指导结构优化,形成"磁路设计-有限元验证-参数修正"的闭环设计流程,为磁轴承的精确设计和性能评估提供可靠依据。

技术工作者 1298

从零搭建企业级AI网关:基于LiteLLM的安全防护体系设计

本文详细介绍了如何从零搭建企业级AI网关,基于LiteLLM构建全面的安全防护体系。内容涵盖分层防御架构、敏感数据处理、合规性配置与审计追踪,以及生产环境部署策略,助力企业安全高效地集成LLM技术,确保数据安全和合规性。

qq_27496129的博客 1293

手机二维码~~~ZXing简介

本文来自http://blog.youkuaiyun.com/hellogv/       最近3G不断在发力,商务部也主动牵头推动移动电子商务的发展,所以,针对企业应用、消费辅助类的J2ME软件将以更快的速度涌现。这里,我要介绍的是,手机的新应用----手机二维码。    什么是一维码、二维码?一维码就是商品包装盒上的条形码,而二维码就是。。。。。。类似“马赛克”打格的图像,以图像中的黑白点数量、大小来表示

hellogv的专栏 8497

汇川H5U PLC 实现直线插补、圆弧插补、直线圆弧混合连续插补

使用汇川H5UPLC实现直线插补,圆弧插补,直线圆弧混合路径插补,通过示教可以走出复杂的路径,仅供参考学习。

weixin_39832501的博客 4788

获取网站的实时股票数据

以下代码可以解析WAP的PHP网页以及JSP网页;如果是要解析JSP网页,代码可以更加简略。/** *本文来自http://blog.youkuaiyun.com/hellogv/ * 这个单元负责全局函数 */import java.io.*;import java.util.*;import javax.microedition.midlet.*;

hellogv的专栏 8140

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

LWUIT 上使用List实现表格

本文来自http://blog.youkuaiyun.com/hellogv/ ,引用必须注明出处!      最近越来越多人用LWUIT,问得问题也越来越多了。最近超级多人问的是,如何使用List实现表格。以前我用Grid实现了表格(http://blog.youkuaiyun.com/hellogv/archive/2009/01/12/3759984.aspx),现在就来说说如何

hellogv的专栏 8026

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

使用J2ME发送手机短信

以下代码出自http://blog.youkuaiyun.com/hellogv/,引用请注明出处!小弟有一部索爱的K508C,在学习J2ME时,发觉它竟是MIDP2.0,因此,就利用它来开始自己的移动开发之旅。  首先,要加入以下这两句必须的库引用:import javax.wireless.messaging.MessageConnection;import javax.wireles

hellogv的专栏 6764

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

J2ME GUI实战之一 ----------LWUIT简介

本文来自:http://blog.youkuaiyun.com/hellogv/ ,转载必须注明出处!首先,想让大家看看LWUIT可以做出什么界面:这种界面,用J2ME-Polish也不难做出来,但是作者我更喜欢LWUIT,因为她发展得很快很快,觉得值得大家关注!!好了,继续介绍,以下内容摘自网络:Sun发布了LWUIT(Light-Weight UI Toolkit)的源代码以及示例代码(示例后面会详细说明

hellogv的专栏 6732

J2ME GUI实战之二 ----------LWUIT实现手机九宫图

 本文来自:http://blog.youkuaiyun.com/hellogv/ ,转载必须注明出处! 本文的源代码,已放到 http://download.youkuaiyun.com/user/hellogv 供大家下载!首先,想让大家看看九宫图实现之后的界面:本文所用的代码,是来自LWUIT所提供的Sample例子,但是对例子做出以下修改:1.设计自主的res资源文件2.把builde.xml里面的 。。。。。

hellogv的专栏 6519

用最少的代码来,美化你的J2ME程序!

以下代码出自http://blog.youkuaiyun.com/hellogv/,引用请注明出处!在开始本文之前,请确定你自己,是否想把你的J2ME程序界面改为以下这样:   如果你已经想好了,想把你J2ME程序改成这样,那么,请继续往下看.......  在动手美化你的J2ME程序之前,请准备以下:  1。请到http://www.enough.de/news.html下载j2me

hellogv的专栏 6087

J2ME的RMS读写实现

以下代码出自http://blog.youkuaiyun.com/hellogv/,引用请注明出处!  在实现RMS的读写前,首先要注意RMS对汉字不兼容,为了解决这个这个首要问题,首先要编写以下两个成员函数:public byte[] StringtoBytes(String Str) { //写成字节byte[] STB = null;try {ByteArrayOutpu

hellogv的专栏 6039

LWUIT + ChartComponent 之一实现饼图(PieChart)

本文来自http://blog.youkuaiyun.com/hellogv/     本文源代码下载地址:http://download.youkuaiyun.com/source/872671    本文所用的Chart组件为J2me ChartComponent - ver 1.5.2,该组件的下载页面为http://www.beanizer.org/site/index.php/en/Software/J2me-

hellogv的专栏 6005

J2ME GUI实战之四 ----------LWUIT的Button使用以及窗体布局

  function StorePage(){d=document;t=d.selection?(d.selection.type!=None?d.selection.createRange().text:):(d.getSelection?d.getSelection():);void(keyit=window.open(http://www.365key.com/storeit.

hellogv的专栏 5794
上一篇: J2ME GUI实战之七 ----------LWUIT的Tabbed分页、Text文本
下一篇: JAVA实现整句汉字拆分、转换为ASCII
欧巴Godwin
欧巴Godwin 领域专家: 操作系统技术领域 领域专家: 操作系统技术领域
博客等级 码龄20年 9690粉丝 141原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值