如何创建下拉菜单,使用LWUIT?存在哪些解决方案?

发布于 2024-12-15 17:28:45 字数 104 浏览 3 评论 0原文

我需要创建下拉菜单(见图)。有哪些方法呢?我应该用什么?

在此处输入图像描述

I need to create drop down menu (see the picture). What methods are there? What should I use?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

究竟谁懂我的在乎 2024-12-22 17:28:45

创建一个派生 Dialog 的类,并在该 Dialog 内添加一个 List。当您单击按钮时,将显示带有顶部、底部、左侧和右侧四个参数的对话框。

要绘制下拉菜单的三角形,只需在派生调用的 Dialog 时实现 Paint 方法:

super.paint(g);
g.drawLine(x1,y1,x2,y2);
g.drawLine(x3,y3,x4,y4);

Create a class which derives Dialog , and add a List inside that Dialog. When you click the button then show the Dialog with the four params top, bottom, left and right.

To draw the triangle of the drop down menu just implement the paint method when you derive Dialog in which you call :

super.paint(g);
g.drawLine(x1,y1,x2,y2);
g.drawLine(x3,y3,x4,y4);
场罚期间 2024-12-22 17:28:45

LWUIT 1.5 包含一个弹出对话框,它正是这样做的。它还能够在指定时使用箭头边框。请参阅 LWUITDemo 的对话框演示。

LWUIT 1.5 includes a popup dialog which does exactly that. It also has the ability to use an arrow border when specified. See the LWUITDemo's Dialog demo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文