java programming language basics phần 7

Con trỏ Tập trung vào người dùng cuối có thể sử dụng phím Tab để di chuyển con trỏ từ một trong những thành phần khác trong giao diện người dùng. Tab mặc định phím chuyển động bước qua tất cả các thành phần giao diện người dùng | Java TM Language Basics Part 2 Lesson 2 User Interfaces Revisited http Programming BasicJava2 icost itotal catch Exception e Cannot send data to server pearQnt Text Field The pearQnt text field behavior involves retrieving the number of pears the end user wants to order adding the number to the items total using the number to calculate the cost and adding the cost for pears to the total cost. Two interesting things in this code involve managing the cursor focus and converting strings to numbers for the calculations. Both topics are covered below. if source pearqnt number if 0 pearsNo number itotal creditCard else itotal 0 creditCard Cursor Focus End users can use the Tab key to move the cursor from one component to another within the user interface. The default Tab key movement steps through all user interface components including the text areas. Because the end user does not interact with the text areas there is no reason for the cursor to go there. The example program includes a call in its constructor to to make the cursor move from the pearqnt text field to the creditcard text field bypassing the total cost and total items text areas when the Tab key is pressed. applechk new JLabel Apples appleqnt new JTextField this pearchk new JLabel Pears pearqnt new JTextField this peachchk new JLabel Peaches peachqnt new JTextField this cardNum new JLabel Credit Card creditCard new JTextField Make cursor go to creditCard component creditCard customer new JTextField custID new JLabel Customer ID 8 of 13 21-04-2000 17 33 Java TM Language Basics Part 2 Lesson 2 User Interfaces Revisited http .

Bấm vào đây để xem trước nội dung
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
66    86    2    26-06-2024
4    100    2    26-06-2024
157    179    18    26-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.