LWUIT 1.1 for Java ME Developers- P3

Tham khảo tài liệu 'lwuit for java me developers- p3', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 4 In the above code snippet from the DemoLabel MIDlet we have two commented out statements for setting text position and alignment. If the first statement is uncommented then the text will be aligned along the top of the label. Uncommenting the second statement will position the text on the left of the icon. If both are uncommented what we get is shown in the following screenshot If the image for bothLabel cannot be accessed an IOException will be thrown. Within the catch block we add a message to the existing text which is retrieved by calling the public String getText method. Here we also set a flag to indicate that the icon could not be set. The border for bothLabel is a RoundBorder. The createRoundBorder method takes three arguments. The first two define the diameters of the arcs at the corners the horizontal and the vertical respectively. The third is an optional one that specifies the color. This last parameter may be left out. In that case the foreground color of the component will be used. .setBorder 12 5 OxffOOOO 87 The Label Family After bothLabel is added to the form the noimage flag is checked. If it is true then the text on bothLabel is made to scroll ticker as we know that we have got a fairly long text here. The public void startTicker long delay boolean rightToLeft method has to be called only after a label has been added to a form. This is why we have just set a flag within the catch block. The first parameter of the method specifies the time in milliseconds between two successive shifts during scrolling and the second specifies the direction of scrolling true being the value that denotes right-to-left scrolling. Just as there is a method for starting text scrolling there is one for stopping it too public void stopTicker . if nolmage 100 true To see the text ticker in action change the name of the image for bothLabel from to say sdsym4 . If you recompile and .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.