WebSphere Studio Application Developer Version 5 Programming Guide part 54

WebSphere Studio Application Developer part 54 provides integrated development tools for all e-business development roles, including Web developers, Java developers, business analysts, architects, and enterprise programmers. The customizable, targeted, role-based approach of WebSphere Studio Application Developer will be characteristic of all new products built on the WebSphere Studio Workbench. It is well integrated with WebSphere Application Server and provides built-in server test environments that can be used for testing and profiling Web applications | Once the template is used the cursor will be positioned inside the actionPerformed method. Add the following statement to this method getJTextFieldCustomerSelection .setText getFirstName This statement calls the getFirstName method and writes the return value to the jTextFieldCustomerSelection bean. The getJButtonGetFirstName method is completed now. The bold code is the new action listener code that has been added Figure 14-45 . private getJButtonGetFirstName if jButtonGetFirstName null jButtonGetFirstName new Get First Name jButtonGetFirstName .addActionListener new public void actionPerformed e getJTextFiel dCustomerSelection .setText getFirstName return jButtonGetFirstName Figure 14-45 getJButtonGetFirstName method By now we have finished designing our sample GUI including an event handler and are able to run and test it. Running and testing JavaBeans Once you have written a class using the Visual Editor for Java you may wish to run and test it. If the class has a main method you can use the menu option Run - Java Application. In this section we show how to run the sample as a JavaBean and as a Java application. Additional information about running a Java class is provided in the section Running your programs on page 103. However when you write a JavaBean using the Visual Editor it will not typically have a main method. Rather than having to add a main method to allow you to test JavaBeans classes there is an additional option available from the Run menu called JavaBean that invokes a JavaBean launcher. 504 WebSphere Studio Application Developer Version 5 Programming Guide By comparison in VisualAge for Java you could not test a JavaBean and you could only execute JavaBeans through the mai n method. Visual Age for Java was able to generate a default implementation of the main method to help test the JavaBean. Running the sample GUI as a .

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