Using Java to Write an Event Handler
How to create an event handler class and add it to the Java project
1 In Navigator, select a Java project and choose File→Properties. In Properties, select Java Build Path→Libraries. In Java Build Path, choose Add External JARs.
3 Figure 23-1 The report engine JAR file in the build path
2
![]()
Figure 23-2 Selecting a Superclass
4 Figure 23-3 New Java Class final propertiesFigure 23-4 The new class in the Java editor
6 Add the event handler method for the event handler class. Import all required classes. Figure 23-5 shows the addition of an onPrepare( ) method that sets the background color of a label to red.Figure 23-5 The onPrepare( ) method in the Java editor
7 Choose File→Save.How to associate a Java class with a report element
The steps in this procedure make the following assumptions:
1 Figure 23-6 Selecting a report elementFigure 23-7 Event handler properties
4 Figure 23-8 Selecting the event handler classThe fully qualified name of the event handler class appears in Property Editor, as shown in Figure 23-9.Figure 23-9 The event handler class name
(c) Copyright Actuate Corporation 2013 |