[LTM] Chương 5.11 : Choice (List, menu)

Người đăng: share-nhungdieuhay on Thứ Ba, 25 tháng 3, 2014

Lists
Hiển thị một danh sách chọn lựa cho người dùng
Lớp Choice: tạo ra danh sách nhiều item, ex
Choice Names = new Choice();
Thêm item: dùng phương thức addItem()

  • Names.addItem(“Antonio”);
  • Names.addItem(“Leonardo”);

Chọn 1 item: dùng getSelectedItem()


  •   Names.getSelectedItem()==“Antonio”



Menu 
Xây dựng hệ thống thực đơn cho chương trình
Dùng các lớp MenuBar, Menu, MenuItem
Abstract class MenuComponent is based class:
  • MenuBar class: define menu bar
  • MenuItem class: define Item in menu bar
  • Menu class: set up pull-down menu in a Item menu
  • PopUpMenu class: display for pop-up menu
  • CheckboxMenuItem class: contain items menu checked



{ 0 nhận xét... read them below or add one }

Đăng nhận xét