范例:使用Text Areas 使用label显示图像,text area 处理文本 JPanel JFrame DescriptionPanel TextAreaDemo -jlblImage -jlblTitle -jtaTextDescription 源码 +setImagelcon +setTitle +setTextDescription +getMinimumSize ©2006计算机系杨厚群 All rights lefts reserved
©2006 计算机系 杨厚群 All rights & lefts reserved. 范例:使用 Text Areas 使用label显示图像, text area 处理文本 DescriptionPanel -jlblImage -jlblTitle -jtaTextDescription +setImageIcon +setTitle +setTextDescription +getMinimumSize 1 1 TextAreaDemo JPanel -char token +getToken +setToken +paintComponet +mouseClicked JFrame -char token +getToken +setToken +paintComponet +mouseClicked 源码
JComboBox combo box是允许用户选择的列表组件,与 1ist组件类似,但仅允许单项选择。创建列表 组件可使用缺省构造函数: JComboBox ( 范例:使用Combo Boxes 源码 ©2006计算机系杨厚群 All rights lefts reserved
©2006 计算机系 杨厚群 All rights & lefts reserved. JComboBox combo box 是允许用户选择的列表组件,与 list组件类似,但仅允许单项选择。创建列表 组件可使用缺省构造函数: JComboBox() 范例: 使用 Combo Boxes 源码
JComboBox的方法 加入新项到JComboBox(jcbo)中,使用 jcbo.addItem(Object item) 从JComboBox(jcbo)获取一项,使用 jcbo.getItem() ©2006计算机系杨厚群 All rights lefts reserved
©2006 计算机系 杨厚群 All rights & lefts reserved. JComboBox 的方法 加入新项到JComboBox(jcbo)中,使用 jcbo.addItem(Object item) 从JComboBox(jcbo)获取一项,使用 jcbo.getItem()