Đang chuẩn bị liên kết để tải về tài liệu:
java programming language basics phần 7

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

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 developer.java.sun.com developer.Training Programming BasicJava2 ui.html send.sendTotalCost icost send.sendTotalltems itotal catch Exception e System.out.println 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 pearqnt.getText if number.length 0 pearsNo Integer.valueOf number itotal pearsNo.intValue pearqnt.setNextFocusableComponent creditCard else itotal 0 pearqnt.setNextFocusableComponent 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 pearqnt.setNextFocusableComponent 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 appleqnt.addActionListener this pearchk new JLabel Pears pearqnt new JTextField pearqnt.addActionListener this peachchk new JLabel Peaches peachqnt new JTextField peachqnt.addActionListener this cardNum new JLabel Credit Card creditCard new JTextField Make cursor go to creditCard component pearqnt.setNextFocusableComponent 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 .

Đã 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.