java获取jConboBox的选项,介绍JComponentPack产品中的AComboBox控件

Introduce the AComboBox component

Overview The

AComboBox is a drop down component in

JComponentPack product, it’s different with the “

JComboBox” component in the core Java swing package, it can set the popup icon, popup component, etc.

Main Features

1. Customize the popup icon

The AComboBox component have the method “setPopupIcon(Icon)”, you can change the popup icon for your requirements, see the screenshot:

calendar.jpg

2. Customize the popup component

The AComboBox component have the method “setPopupComponent(Component), you can set the component will be display in the drop down menu.

3. Customize the component factory, this is a new feature since JComponentPack 1.1.0, You can configure the popup icon, popup component based the current value’s type, the method “setComponentFactory(AbstractComponentFactory)” in AComboBox can be used for this goal.

AComboBox currently provide a default AbstractComponentFactory, it can configure the Date value to use the calendar popup icon and JCalendar component, see the article “JCalendar new features in JComponentPack 1.1.0” for details.

Sample Code

Configure the AComboBoxcomponent to use the Date value

// create the AComboBox

AComboBox comboBox = new AComboBox();

comboBox.setValue(new Date());

// configure the date format

DateCellRenderer renderer = (DateCellRenderer) comboBox.getRenderer();

renderer.setFormat(DateFormat.getDateInstance());

07b0977239911ba5290fba31f7d1237c.png

--------------------------

新闻:

瑞星微点之争引发全民深思中国式道德

导航:

博客园首页

知识库

新闻

招聘

社区

小组

博问

网摘

找找看

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值