Java The Complete Reference, Seventh Edition
848 Part III: Software Development Using Java Advantages of Java Beans The following list enumerates some of the benefits that J ...
Chapter 28: Java Beans 849 public void setDepth(double d) { depth = d; } public double getHeight( ) { return height; } public vo ...
850 Part III: Software Development Using Java These methods are used to add or remove a listener for the specified event. The ve ...
Chapter 28: Java Beans 851 interest in receiving such notifications. A class that handles this event must implement the Property ...
852 Part III: Software Development Using Java Interface Description AppletInitializer Methods in this inter face are used to ini ...
Chapter 28: Java Beans 853 Introspector TheIntrospectorclass provides several static methods that support introspection. Of most ...
854 Part III: Software Development Using Java PropertyDescriptor ThePropertyDescriptorclass describes a Bean property. It suppor ...
Chapter 28: Java Beans 855 public boolean getRectangular() { return rectangular; } public void setRectangular(boolean flag) { th ...
Here, the first argument is the name of the property, and the second argument is the class of the Bean. // A Bean information cl ...
The output from this program is the following: Properties: rectangular Events: mouseWheel mouse mouseMotion component hierarchyB ...
This page intentionally left blank ...
29 Introducing Swing I n Part II, you saw how to build user interfaces with the AWT classes. Although the AWT is still a crucial ...
860 Part III: Software Development Using Java Not long after Java’s original release, it became apparent that the limitations an ...
Chapter 29: Introducing Swing 861 and feel that acts like a specific platform. For example, if you know that an application will ...
862 Part III: Software Development Using Java by interfaces. For example, the model for a button is defined by theButtonModelint ...
Notice that all component classes begin with the letterJ. For example, the class for a label isJLabel; the class for a push butt ...
864 Part III: Software Development Using Java javax.swing javax.swing.border javax.swing.colorchooser javax.swing.event javax.sw ...
JLabel jlab = new JLabel(" Swing means powerful GUIs."); // Add the label to the content pane. jfrm.add(jlab); // Display the fr ...
866 Part III: Software Development Using Java Next, the window is sized using this statement: jfrm.setSize(275, 100); ThesetSize ...
Theadd( )method is inherited byJFramefrom the AWT classContainer. By default, the content pane associated with aJFrameuses borde ...
«
40
41
42
43
44
45
46
47
48
49
»
Free download pdf