<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Java Web Hosting, Php5 Hosting, Mysql, Java, Jsp, Servlet, Tomcat, Ssh Blog</title>
	<link>http://www.bluewebsitehosting.net</link>
	<description>Mysql, Java, Jsp, Servlet, Tomcat, Ssh Blog</description>
	<pubDate>Mon, 04 Feb 2008 00:06:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>Web hosting ecommerce - Java Swing - O Reilly // SelectableTest.java // A</title>
		<link>http://www.bluewebsitehosting.net/blue/web-hosting-ecommerce-java-swing-o-reilly-selectabletestjava-a/</link>
		<comments>http://www.bluewebsitehosting.net/blue/web-hosting-ecommerce-java-swing-o-reilly-selectabletestjava-a/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 00:06:35 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/web-hosting-ecommerce-java-swing-o-reilly-selectabletestjava-a/</guid>
		<description><![CDATA[Java Swing - O Reilly   //    SelectableTest.java // A test of the SelectableTextArea class. // import javax.swing.*; import java.awt.BorderLayout;    public class SelectableTest extends JFrame {    public SelectableTest() { super(&#8221;Selectable Text Area Test&#8221;); setSize(400, 300); addWindowListener(new BasicWindowMonitor());    SelectableTextArea sta = new SelectableTextArea(&#8221;Starter [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   //    SelectableTest.java // A test of the SelectableTextArea class. // import javax.swing.*; import java.awt.BorderLayout;    public class SelectableTest extends JFrame {    public SelectableTest() { super(&#8221;Selectable Text Area Test&#8221;); setSize(400, 300); addWindowListener(new BasicWindowMonitor());    SelectableTextArea sta = new SelectableTextArea(&#8221;Starter text&#8221;, 8, 40); getContentPane().add(sta, BorderLayout.CENTER); }    public static void main(String args[]) { SelectableTest st = new SelectableTest(); st.setVisible(true);   } }   27.3.2.1 Properties  The KeyStroke class contains the properties shown in Table 27.7. The keyChar property is the  character this keystroke represents, such as A or $. The keyCode property is the int value associated  with a particular key on your keyboard. This might be the ASCII value of a letter, or some other  value associated with a function key. The modifiers property contains information on whether or  not any of the modifier keys (Control, Alt, Meta, Shift) are attached to this keystroke. The  acceptable key codes come from the java.awt.event. KeyEvent class and are shown in Table   27.8. The onKeyRelease property determines when events associated with this keystroke should be  triggered. A true value treats the keystroke as a keyTyped() event, while a false value behaves  like keyPressed() event.  Table 27.7, KeyStroke Properties  Property Data Type get is set bound Default Value  keyChar char &#8221; &#8221;  keyCode int 0  modifiers int 0  onKeyRelease boolean false  27.3.2.2 Key Codes  Just for your reference, here&#8217;s a table of the valid key codes from the java.awt.event.KeyEventclass. You&#8217;ll notice that many of the key code values correspond to the ASCII value of the character  associated with the key. This facilitates coding for the common keys, because you can use shortcuts  like &#8216;R&#8217; instead of KeyEvent.VK_R wherever a key code is expected. Of course, as a good  programmer, you always use the constant, right? (We left out character equivalents that were not  related to the VK key.)   Table 27.8, Valid Key Codes for Use with KeyStroke   KeyEvent   Decimal   Hexadecimal   char   KeyEvent Constant   Decimal   Hexadecimal   char   - 932    #BREAK# Java Swing - O Reilly   Constant Value Value equivalent Value Value equivalent  VK_0 48 0&#215;30 &#8220;0&#8243; VK_X 88 0&#215;58 &#8220;X&#8221;  VK_1 49 0&#215;31 &#8220;1&#8243; VK_Y 89 0&#215;59 &#8220;Y&#8221;  VK_2 50 0&#215;32 &#8220;2&#8243; VK_Z 90 0&#215;5a &#8220;Z&#8221;  VK_3 51 0&#215;33 &#8220;3&#8243; VK_ACCEPT 30 0&#215;1e  VK_4 52 0&#215;34 &#8220;4&#8243; VK_ADD 107 0&#215;6b  VK_5 53 0&#215;35 &#8220;5&#8243; VK_ALT 18 0&#215;12  VK_6 54 0&#215;36 &#8220;6&#8243; VK_BACK_QUOTE 192 0xc0  VK_7 55 0&#215;37 &#8220;7&#8243; VK_BACK_SLASH 92 0&#215;5c &#8220;\&#8221;  VK_8 56 0&#215;38 &#8220;8&#8243; VK_BACK_SPACE 8 0&#215;08 &#8220;b&#8221;  VK_9 57 0&#215;39 &#8220;9&#8243; VK_CANCEL 3 0&#215;03  VK_A 65 0&#215;41 &#8220;A&#8221; VK_CAPS_LOCK 20 0&#215;14  VK_B 66 0&#215;42 &#8220;B&#8221; VK_CLEAR 12 0&#215;0c  VK_C 67 0&#215;43 &#8220;C&#8221; VK_CLOSE_BRACKET 93 0&#215;5d &#8220;]&#8221;  VK_D 68 0&#215;44 &#8220;D&#8221; VK_COMMA 44 0&#215;2c &#8220;,&#8221;  VK_E 69 0&#215;45 &#8220;E&#8221; VK_CONTROL 17 0&#215;11  VK_F 70 0&#215;46 &#8220;F&#8221; VK_CONVERT 28 0&#215;1c  VK_G 71 0&#215;47 &#8220;G&#8221; VK_DECIMAL 110 0&#215;6e  VK_H 72 0&#215;48 &#8220;H&#8221; VK_DELETE 127 0&#215;7f  VK_I 73 0&#215;49 &#8220;I&#8221; VK_DIVIDE 111 0&#215;6f  VK_J 74 0&#215;4a &#8220;J&#8221; VK_DOWN 40 0&#215;28  VK_K 75 0&#215;4b &#8220;K&#8221; VK_END 35 0&#215;23  VK_L 76 0&#215;4c &#8220;L&#8221; VK_ENTER 10 0&#215;0a &#8220;n&#8221;  VK_M 77 0&#215;4d &#8220;M&#8221; VK_EQUALS 61 0&#215;3d &#8220;=&#8221;  VK_N 78 0&#215;4e &#8220;N&#8221; VK_ESCAPE 27 0&#215;1b  VK_O 79 0&#215;4f &#8220;O&#8221; VK_F1 112 0&#215;70  VK_P 80 0&#215;50 &#8220;P&#8221; VK_F2 113 0&#215;71  VK_Q 81 0&#215;51 &#8220;Q&#8221; VK_F3 114 0&#215;72  VK_R 82 0&#215;52 &#8220;R&#8221; VK_F4 115 0&#215;73  VK_S 83 0&#215;53 &#8220;S&#8221; VK_F5 116 0&#215;74  VK_T 84 0&#215;54 &#8220;T&#8221; VK_F6 117 0&#215;75  VK_U 85 0&#215;55 &#8220;U&#8221; VK_F7 118 0&#215;76  VK_V 86 0&#215;56 &#8220;V&#8221; VK_F8 119 0&#215;77  VK_W 87 0&#215;57 &#8220;W&#8221; VK_F9 120 0&#215;78  VK_F10 121 0&#215;79 VK_NUMPAD7 103 0&#215;67  VK_F11 122 0&#215;7a VK_NUMPAD8 104 0&#215;68  VK_F12 123 0&#215;7b VK_NUMPAD9 105 0&#215;69  VK_FINAL 24 0&#215;18 VK_OPEN_BRACKET 91 0&#215;5b &#8220;[&#8221;  VK_HELP 156 0&#215;9c VK_PAGE_DOWN 34 0&#215;22  VK_HOME 36 0&#215;24 VK_PAGE_UP 33 0&#215;21  VK_INSERT 155 0&#215;9b VK_PAUSE 19 0&#215;13  VK_KANA 21 0&#215;15 VK_PERIOD 46 0&#215;2e &#8220;.&#8221;  VK_KANJI 25 0&#215;19 VK_PRINTSCREEN 154 0&#215;9a   - 933    #BREAK# Java Swing - O Reilly   VK_LEFT 37 0&#215;25 VK_QUOTE 222 0xde  VK_META 157 0&#215;9d VK_RIGHT 39 0&#215;27  VK_MODECHANGE 31 0&#215;1f VK_SCROLL_LOCK 145 0&#215;91  VK_MULTIPLY 106 0&#215;6a VK_SEMICOLON 59 0&#215;3b &#8220;;&#8221;  VK_NONCONVERT 29 0&#215;1d VK_SEPARATER 108 0&#215;6c  VK_NUM_LOCK 144 0&#215;90 VK_SHIFT 16 0&#215;10  VK_NUMPAD0 96 0&#215;60 VK_SLASH 47 0&#215;2f &#8220;/&#8221;  VK_NUMPAD1 97 0&#215;61 VK_SPACE 32 0&#215;20 &#8221; &#8221;  VK_NUMPAD2 98 0&#215;62 VK_SUBTRACT 109 0&#215;6d  VK_NUMPAD3 99 0&#215;63 VK_TAB 9 0&#215;09 &#8220;t&#8221;  VK_NUMPAD4 100 0&#215;64 VK_UNDEFINED 0 0&#215;00  VK_NUMPAD5 101 0&#215;65 VK_UP 38 0&#215;26  VK_NUMPAD6 102 0&#215;66   27.3.2.3 Instantiation Methods  The KeyStroke class does not have a constructor. All keystrokes are cached for you. You can use  any of the following static methods (listed after the table) to retrieve the appropriate instance you&#8217;re  looking for.   public static KeyStroke getKeyStroke(char keyChar)   public static KeyStroke getKeyStroke(char keyChar, boolean onKeyRelease)   Return the KeyStroke that represents a character, such as &#8216;A&#8217;. The onKeyRelease argument  determines whether actions associated with this keystroke are triggered when the key is  pressed (false) or when it is released (true).   public static KeyStroke getKeyStroke(int keyCode, int modifiers) public static KeyStroke getKeyStroke(int keyCode, int modifiers, boolean onKeyRelease)   Return the KeyStroke that represents a given key code and modifier combination. As with  the previous getKeyStroke() methods, the onKeyRelease argument determines when to  fire associated actions.   public static KeyStroke getKeyStroke(String representation)   Returns a KeyStroke from the given representation of the keystroke. This has not been  implemented as of the JDK 1.2 beta 4 release.   public static KeyStroke getKeyStrokeForEvent(KeyEvent anEvent)   Extracts a KeyStroke from anEvent.   27.3.2.4 Overriden Object Methods  KeyStroke overrides the following methods from Object to make them more suitable to the  KeyStroke class:   public int hashCode()   - 934    #BREAK# Java Swing - O Reilly   This method provides, as the documentation puts it, a &#8220;reasonably unique&#8221; hash code for   putting KeyStroke objects into hash tables.   public boolean equals(Object anObject)   Compares all of the KeyStroke properties to determine if two keystrokes are equivalent.   public String toString()   Produces a string equivalent of the KeyStroke object. The modifiers and onKeyRelease  properties are represented as appropriate.   27.3.3 The MouseInputAdapter Class  This simple implementation of the MouseInputListener interface (which is itself just a  conglomeration of the MouseListener and MouseMotionListener interfaces) provides empty  methods for each of the mouse event handlers. You can use this abstract convenience class like any  other adapter, extending it and overriding only the methods that interest you. This one simply has  the benefit of handling both mouse and mouse motion events.   27.3.3.1 Methods  public void mouseClicked(MouseEvent e)  public void mousePressed(MouseEvent e)   public void mouseReleased(MouseEvent e)  public void mouseEntered(MouseEvent e)  public void mouseExited(MouseEvent e)   These methods come from the MouseListener interface. All have empty implementations.   public void mouseDragged(MouseEvent e)  public void mouseMoved(MouseEvent e)   These methods come from the MouseMotionListener interface. Both have empty   implementations.   27.3.3.2 The SwingPropertyChangeSupport Class  Many Swing components support bound properties as defined by the JavaBeans specification. In the  java.beans package, a utility class called PropertyChangeSupport is defined to help you register  property change listeners and fire property change events. The PropertyChangeSupport class does  this work in a thread-safe manner that consumes a good bit of memory. The  SwingPropertyChangeSupport class provides exactly the same set of features, but does so without  thread-safety to reduce memory usage and increase performance. If you&#8217;re building your own  components, you can use this class instead of PropertyChangeSupport. (For more information on  JavaBeans and bound properties, check out O&#8217;Reilly&#8217;s Developing Java Beans, by Robert  Englander.)   27.3.3.3 Constructor  public SwingPropertyChangeSupport(Object sourceBean)   - 935    #BREAK# Java Swing - O Reilly   This constructor creates a new SwingPropertyChangeSupport object with a reference to  sourceBean kept for use in reporting events. The sourceBean will be listed as the source  for all property change events coming from this support object.   27.3.3.4 Methods  public void addPropertyChangeListener(PropertyChangeListener listener)   public void addPropertyChangeListener(String propertyName, PropertyChangeListener  listener) public void removePropertyChangeListener(PropertyChangeListener listener) public void removePropertyChangeListener(String propertyName, PropertyChangeListener  listener)   Add and remove PropertyChangeListener objects interested in receiving property change  events. If you give a propertyName, only changes to the specified property will be reported.   public void firePropertyChange(String propertyName, Object oldValue, Object newValue)   Creates a new PropertyChangeEvent object from propertyName, oldValue and  newValue, then it fires it to any registered listeners.   public void firePropertyChange(PropertyChangeEvent evt)   Fires an existing PropertyChangeEvent, evt, to any registered listeners.   public boolean hasListeners(String propertyName)   Returns true if there are any listeners registered for the given propertyName. If a generic  listener is present, this method returns true, regardless of whether or not any specific  property listeners exist.   27.4 Image Utilities  The last category of utility classes to look at is image utilities. The Swing package contains a class  that can come in handy for generating images.   27.4.1 The GrayFilter Class  The GrayFilter class is an extension of the java.awt.image.RGBImageFilter class. This class  contains a static method that returns a &#8220;disabled&#8221; version of an image passed in. The image is  converted to a grayscale version, and some lighter parts of the image are amplified to ensure the  image is recognizable. All of the components that can display images use this class to present a  default disabled version of the image if an explicit disabled image was not provided.   27.4.1.1 Constructors  public GrayFilter(boolean brighter, int percent)   Creates an instance of the GrayFilter class that you can use to do your own filtering.  (Normally you don&#8217;t call this, but use createDisabledImage() instead.) Both the  brighter and percent arguments are used to convert color pixels to appropriately shaded  gray pixels.   - 936    #BREAK# Java Swing - O Reilly   27.4.1.2 Image Methods  public static Image createDisabledImage(Image i)   Use this method to retrieve a grayed-out version of the image i. This method creates an   instance of the GrayFilter class with brighter turned on and a gray percent of 50.   public int filterRGB(int x, int y, int rgb)   Overrides the filterRGB() method in RGBImageFilter, converts the rgb pixel to a gray   pixel, and returns that.   27.4.2 The Renderer Interface  The Swing package includes a Renderer interface with the following methods:   public Component getComponent()   Returns a Component you can use with something like the   SwingUtilities.paintComponent() method to draw the component.   public void setValue(Object aValue, boolean isSelected)   This method can initialize the rendering component to reflect the state of the object aValue.   This interface could be useful if you were to create a library of renderers for use with your own  applications; however, it is not implemented anywhere in the Swing package as of the JDK1.2 beta4  release.   28.1 Creating Your Own Component  So you&#8217;ve been bitten by the bug. There isn&#8217;t a component anywhere in the Swing library that fits  your needs, and you&#8217;ve decided that it&#8217;s time to write your own. Unfortunately, you&#8217;re dreading the  prospect of creating one, because either you&#8217;ve heard somewhere that it is a complex task, or your  jaw is still bouncing on the floor after browsing through some of the Swing component source code.   This section helps to dispel those fears. Creating your own component isn&#8217;t hard   just extend the  JComponent class with one of your own and away you go! On the other hand, getting it to behave  or even display itself correctly can take a bit of patience and fine tuning. As such, we&#8217;ve provided a  step-by-step guide below as an aid to wary programmers that keep running into those hidden  &#8220;gotchas&#8221; when creating their own components.   Remember that when creating Swing components, it&#8217;s always preferable to create one that adheres  to the JavaBeans standards. Not only can your component be used programmatically, but it can also  be inserted into one of a variety of GUI-builder tools that are prevalent in the market. Therefore,  whenever possible, we try to highlight areas that you can work on to make your components more  JavaBeans friendly.   28.1.1 Creating the Component  First things first. If you haven&#8217;t already, you should read through the JComponent section of Chapter   3. This will help you get a feel of what sort of features you can expect in a Swing component, and  - 937    #BREAK# Java Swing - O Reilly   which ones you might want to use (or even disable) in your own component. If you are creating a  component that is intended as a container, be sure to glance at the overview sections on focus  managers and layout managers as well.[1] Remember that you can use any layout manager with a  Swing component, including those from AWT as well as a few new layout managers exclusively in  Swing.   [1] This is sort of confusing. Because of the class hierarchy of JComponent, all classes that extend it are capable of acting as containers. For example, it is  legal to add a JProgressBarto a JSlider. Clearly, the slider is not meant to act as a container, but Swing will allow it nevertheless&#8230;with  undefined results.   After you&#8217;ve done that, you&#8217;re ready to start. Let&#8217;s go through some steps that will help you pound  out that component idea into workable Swing code.   28.1.1.1 You Should Have a Model and a UI Delegate  If you really want to develop your idea into a true Swing component, you should adhere to the  MVC-based architecture of Swing. This means defining models and UI delegates for each  component. Recall that the model is in charge of storing the state information for the component.  Models typically implement their own model interface, which outlines the accessors and methods  that the model must support. The UI delegate is responsible for painting the component and  handling any input events that are generated. The UI-delegate object always extends the  ComponentUI class, which is the base class for all UI-delegate objects. Finally, the component class  itself extends the abstract JComponent, and ties together the model and the delegate.   Figure 28.1. The three parts of a Swing component    Figure 28.1 shows the key classes and interfaces that are involved in creating a Swing component.  The shaded boxes indicate items that the programmer must provide. This includes the model, the  basic UI delegate and its type class, and an implementation of the component to bundle the model  and UI delegate pieces together. Finally, you may need to create your own model interface if one  does not exist that is suitable to your needs.   If you wish to support multiple look-and-feels with your component, you may consider breaking  your UI-delegate class down into an abstract implementation of functionality that is independent of  look-and-feel (such as those classes found in javax.swing.plaf.basic), as well as functionality  specific to each look-and-feel (such as those in the javax.swing.plaf.metal package or the  com.sun.java.swing.plaf.motif package). Some common functionality that you might find in   - 938    #BREAK# Java Swing - O Reilly   the former is the ability to handle various mouse or keyboard events, while painting and sizing the  component is typically the domain of the latter. See Chapter 26, for more details on look-and-feels.   So now that we know what we have to build, let&#8217;s continue our discussion with a look at each one,  starting with the model.   28.1.2 Creating a Model  The model of the object is responsible for storing the state data of the component. Models are not  hard to build, but they are not necessarily easy either. Here are some important tips to think about  when working with models.   28.1.2.1 Reuse or Extend Existing Models Whenever Possible  This is sound advice. Creating a data model from scratch looks trivial, but it typically takes more  time and effort than most people think. Remember that good models are abstractions of component  state, and are often capable of representing more than one type of component. For example, the  BoundedRangeModel serves the JSlider, JProgressBar, and JScrollBar components. In  addition, models are responsible for storing event listeners, handling synchronization issues, and  firing property change events to the components that use them.   A great deal of time was spent in creating the individual models for the Swing components. And  because they are central to the functionality of the Swing components, you can be assured that  they&#8217;re well tested. For example, with the jog shuttle example that we&#8217;ve created, shown later, we  decided to reuse the BoundedRangeModel. This model does an excellent job with any component  that contains a value within a closed range. Chances are that there might already be a model that  will suit your needs, and you can either reuse or extend it to your liking.   Table 28.1 summarizes the Swing component models that we cover in this book. This should give  you a good feel for whether a certain data model can be reused or extended in your own component.  For an example of a component built with an existing model, take a look at Chapter 16.   Table 28.1, Swing Models  Model Chapter Description  ButtonModel 5 Holds the state of a button (like JButton), including its value, whether or not  it is enabled, armed, selected, or pressed, and supports &#8220;rollover&#8221; images  BoundedRangeModel 6 Holds a value that can vary between fixed maximum and minimum limits; used  for JSlider, JProgressBar, JScrollBar, and their relatives  ComboBoxModel 7 Holds the elements of a list, and a single selected element; used for  JComboBox  ListModel 7 Holds the elements of a list (as in a JList)  ListSelectionModel 7 Holds one or more elements selected from a list  SingleSelectionModel 14 Holds an index into an array of possible selections; used by JMenuBar and  JPopupMenu  TableModel 15 Holds a two-dimensional array of data; the basis for JTable  TableColumnModel 15 Controls the manipulation of columns in a table  TreeModel 17 Holds items that can be displayed with branches; used by JTree  TreeSelectionModel 17 Holds one or more elements selected from a tree  Document 20 Holds the content (i.e., text) of a document that might be displayed in an editor;  used by the text components  28.1.2.2 Decide on Properties and Create the Model Interface  - 939    #BREAK# Java Swing - O Reilly   This is the fun part. You should decide which properties will be located in the model and how to  access them. Properties can be read-write, read-only, or write-only. They can be any type of object  or primitive data type. Also, according to the JavaBeans standard, properties can be indexed, as well  as bound or constrained. For an explanation of these qualifiers, see Table 28.2.   Table 28.2, Property Types   Property  Type Description  Bound The property must send a PropertyChangeEvent to all registered listeners when it changes state  Indexed The property is an array of objects or values. Accessors must provide an index to determine which  element they want to set or retrieve  Constrained The property must fire a VetoableChangeEvent to all registered listeners before it changes state. Any one  listener is allowed to veto the state change, at which point the original property state is preserved   As you are probably aware, there are three types of accessors that you will commonly use for object  properties: &#8220;get,&#8221; &#8220;set,&#8221; and &#8220;is.&#8221; You can use the &#8220;get&#8221; accessor to retrieve an object or primitive  property, the &#8220;set&#8221; accessor to reset the value of an object or primitive property, and the &#8220;is&#8221;  accessor to retrieve a boolean property from a component. (For boolean properties, developers tend  to provide an &#8220;is&#8221; accessor and omit the &#8220;get,&#8221; but it&#8217;s not necessary to follow that convention.) The  JavaBeans standard states that property accessors should adhere to the method signatures shown in  Table 28.3. The italicized PropertyType in the table should reflect the object or primitive type of the  property.   Table 28.3, Method Signatures for Property Accessors   Type &#8220;get&#8221; Accessor &#8220;set&#8221; Accessor &#8220;is&#8221; Accessor   <br />Searching for affordable and proven webhost to host and run your servlet applications? Go to <a href="http://linux.wikiwebsitehosting.com">Linux Web Hosting</a> services and you will find it.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/web-hosting-ecommerce-java-swing-o-reilly-selectabletestjava-a/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Java Swing - O Reilly Removes  (Free web hosting with ftp) a listener from</title>
		<link>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-removes-free-web-hosting-with-ftp-a-listener-from/</link>
		<comments>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-removes-free-web-hosting-with-ftp-a-listener-from/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 12:21:23 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-removes-free-web-hosting-with-ftp-a-listener-from/</guid>
		<description><![CDATA[Java Swing - O Reilly   Removes a listener from the list of listeners. It is synchronized, in an effort to make this  class as thread-safe as possible.   27.3.2 The KeyStroke Class  Another convenient class for dealing with events is the KeyStroke class. This class allows you to  associate [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   Removes a listener from the list of listeners. It is synchronized, in an effort to make this  class as thread-safe as possible.   27.3.2 The KeyStroke Class  Another convenient class for dealing with events is the KeyStroke class. This class allows you to  associate actions with particular events through the KeyMap class. Figure 27.5 shows an example of  a JTextArea with support for the &#8220;CTRL-A&#8221; select-all action, using a KeyStroke.   Figure 27.5. A text area with support for a &#8220;Select All&#8221; keyboard shortcut    Here&#8217;s the code that created the selectable text area. With the help of the AbstractAction class and  the selectAll() method in JTextComponent, the code is very simple. We get the KeyMap for the  text area and add in an association between the CTRL-A keystroke and the selectAll() method  using the addActionForKeyStroke() method. The getKeyStroke() call gives us the correct keystroke, and the call to the selectAll() is encapsulated in the Action object. It doesn&#8217;t take much  code:   //    SelectableTextArea  // A class that extends JTextArea and supports the common Ctrl-A shortcut // for selecting all of the text in the field. // import java.awt.event.*; import javax.swing.*; import javax.swing.text.*;    public class SelectableTextArea extends JTextArea {   public SelectableTextArea(String text, int rows, int cols) { super(text, rows, cols); Keymap km = getKeymap();    // get the &#8220;Ctrl-A&#8221; key code // and attach it to a selectAll() call for this component km.addActionForKeyStroke(   KeyStroke.getKeyStroke(&#8217;A', KeyEvent.CTRL_MASK, true), new AbstractAction() { public void actionPerformed(ActionEvent ae) { SelectableTextArea.this.selectAll(); } } ); } }   And the application that puts this text area to use is also straightforward:   - 931     <br />Searching for affordable and proven webhost to host and run your servlet applications? Go to <a href="http://linux.wikiwebsitehosting.com">Linux Web Hosting</a> services and you will find it.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-removes-free-web-hosting-with-ftp-a-listener-from/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Web hosting ecommerce - Java Swing - O Reilly SecretTest st = new</title>
		<link>http://www.bluewebsitehosting.net/blue/web-hosting-ecommerce-java-swing-o-reilly-secrettest-st-new/</link>
		<comments>http://www.bluewebsitehosting.net/blue/web-hosting-ecommerce-java-swing-o-reilly-secrettest-st-new/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 02:00:41 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/web-hosting-ecommerce-java-swing-o-reilly-secrettest-st-new/</guid>
		<description><![CDATA[Java Swing - O Reilly   SecretTest st = new SecretTest(); st.setVisible(true); } }   If you have set up your own event source components before, the EventListenerList class may  not seem to provide much improvement. But, as the documentation points out, it provides a single  access point for serializing your [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   SecretTest st = new SecretTest(); st.setVisible(true); } }   If you have set up your own event source components before, the EventListenerList class may  not seem to provide much improvement. But, as the documentation points out, it provides a single  access point for serializing your list of listeners.   27.3.1.1 Field  protected transient java.lang.Object[] listenerList   This field holds the list of class types and listeners.   27.3.1.2 Constructor  public EventListenerList()   Creates a new listener list.   27.3.1.3 Listener Methods  public synchronized void add(Class t, EventListener l)   Adds a new listener to the list of listeners. It is synchronized, in an effort to make this class  as thread-safe as possible.   public int getListenerCount()   public int getListenerCount(Class t)   Return a count of how many listeners are contained in the list. If a Class argument is  provided, you get the number of listeners of that type in the list.   public Object[] getListenerList()   Returns an array of objects organized as in Figure 27.4. The listener type entry is always a  Class object. You typically work through this array in increments (or decrements) of 2.   Figure 27.4. The EventListenerList object array structure    public synchronized remove(Class t, EventListener l)   - 930     <br />In case you need quality webspace to host and run your web applications, try our <a href="http://j2ee.wikiwebsitehosting.com">personal web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/web-hosting-ecommerce-java-swing-o-reilly-secrettest-st-new/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Java Swing - O Reilly } public void mousePressed(MouseEvent  (Sri lanka web server)</title>
		<link>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-public-void-mousepressedmouseevent-sri-lanka-web-server/</link>
		<comments>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-public-void-mousepressedmouseevent-sri-lanka-web-server/#comments</comments>
		<pubDate>Sat, 02 Feb 2008 15:26:44 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-public-void-mousepressedmouseevent-sri-lanka-web-server/</guid>
		<description><![CDATA[Java Swing - O Reilly   }   public void mousePressed(MouseEvent me) {} public void mouseReleased(MouseEvent me) {} public void mouseEntered(MouseEvent me) {} public void mouseExited(MouseEvent me) {}    protected void fireActionPerformed(ActionEvent ae) { Object[] listeners = listenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i&#8211;) {  [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   }   public void mousePressed(MouseEvent me) {} public void mouseReleased(MouseEvent me) {} public void mouseEntered(MouseEvent me) {} public void mouseExited(MouseEvent me) {}    protected void fireActionPerformed(ActionEvent ae) { Object[] listeners = listenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i&#8211;) {   if (listeners[i] == ActionListener.class) { ((ActionListener)listeners[i+1]).actionPerformed(ae); } } } }   Our addActionListener() and removeActionListener() methods just defer to a listener list to  register and unregister listeners. We don&#8217;t have to do anything special to get an  EventListenerList; we&#8217;re extending JLabel, and therefore inherit a listenerList field from  JComponent. fireActionPerformed() does the actual work; it calls the actionPerformed() method of every action listener stored in the listener list. Note that we walk through the array of  listeners two at a time; as we&#8217;ll see below, the elements in this array alternate between Class  objects that tell us what kind of listener we have, and the actual listener objects themselves. Figure   27.4 shows how the array is set up.  And here&#8217;s the application that creates the SecretLabel and hooks it up to the reporting label. We  use the same addActionListener() that we would for things like buttons or lists:   //    SecretTest.java // A demonstration framework for the EventListenerList-enabled SecretLabel class.  // import javax.swing.*; import java.awt.event.*; import java.awt.*;    public class SecretTest extends JFrame {    public SecretTest() { super(&#8221;EventListenerList Demo&#8221;); setSize(200, 100); addWindowListener(new BasicWindowMonitor());    SecretLabel secret = new SecretLabel(&#8221;Try Clicking Me&#8221;); final JLabel reporter = new JLabel(&#8221;Event reports will show here&#8230;&#8221;); secret.addActionListener(new ActionListener() {  public void actionPerformed(ActionEvent ae) { reporter.setText(&#8221;Got it: &#8221; + ae.getActionCommand());   } } ); getContentPane().add(secret, BorderLayout.NORTH); getContentPane().add(reporter, BorderLayout.SOUTH);   }   public static void main(String args[]) {   - 929     <br />Please visit <a href="http://domain.wikiwebsitehosting.com">Domain Name Hosting</a> services for high quality webhost to host and run your jsp applications.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-public-void-mousepressedmouseevent-sri-lanka-web-server/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Java Swing - O Reilly Here is a SecretLabel  (Web site development)</title>
		<link>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-here-is-a-secretlabel-web-site-development/</link>
		<comments>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-here-is-a-secretlabel-web-site-development/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 09:18:50 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-here-is-a-secretlabel-web-site-development/</guid>
		<description><![CDATA[Java Swing - O Reilly   Here is a SecretLabel class that extends JLabel and fires ActionEvent messages when clicked.  The label does not give any indication it has been clicked, hence its secret nature. The code for this  label demonstrates how an EventListenerList is typically used. Figure 27.3 shows the  [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   Here is a SecretLabel class that extends JLabel and fires ActionEvent messages when clicked.  The label does not give any indication it has been clicked, hence its secret nature. The code for this  label demonstrates how an EventListenerList is typically used. Figure 27.3 shows the  SecretLabel up and running.   Figure 27.3. A JLabel that uses an EventListenerList to facilitate dispatching events    We set up the standard addActionListener() and removeActionListener() methods, which  delegate to the listener list, and pass in the type of listener we&#8217;re attaching. (Recall that  EventListenerList can store any type of listener.) When we actually fire an event, we search the  listener list array, checking the even-numbered indices for a particular type of listener. If we find  the right type (ActionListener, in this case) we use the next entry in the list as an event recipient.  You can find other such examples throughout the Swing package in such models as  DefaultTreeModel, DefaultTableModel, and DefaultButtonModel.   The EventListenerList provides a generic dispatcher that works in just about every situation.  However, it is not the only way to dispatch events. For a particular application you may find a more  efficient means.   //    SecretLabel.java // An extension of the JLabel class that listens to mouse clicks and converts // them to ActionEvents, in turn are reported via an EventListenersList object. // import java.awt.*; import java.awt.event.*; import javax.swing.*;    public class SecretLabel extends JLabel implements MouseListener {    public SecretLabel(String msg) { super(msg); addMouseListener(this);   }   public void addActionListener(ActionListener l) { // We&#8217;ll just use the listenerList we inherit from JComponent listenerList.add(ActionListener.class, l);   }   public void removeActionListener(ActionListener l) { listenerList.remove(ActionListener.class, l); }    public void mouseClicked(MouseEvent me) { fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, &#8220;SecretMessage&#8221;));    - 928     <br />Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to <a href="http://mysql5.solidwebhosting.net">servlet web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-here-is-a-secretlabel-web-site-development/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Java Swing -  (Ftp web hosting) O Reilly This field contains a</title>
		<link>http://www.bluewebsitehosting.net/blue/java-swing-ftp-web-hosting-o-reilly-this-field-contains-a/</link>
		<comments>http://www.bluewebsitehosting.net/blue/java-swing-ftp-web-hosting-o-reilly-this-field-contains-a/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 21:25:27 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/java-swing-ftp-web-hosting-o-reilly-this-field-contains-a/</guid>
		<description><![CDATA[Java Swing - O Reilly   This field contains a wrapped reference to the editor component. The EditorDelegateinner class delegates calls such as isCellEditable() to the component it contains, but also  listens for events that indicate editing has stopped. For the three possible types of editors, a  &#8220;stop event&#8221; from the contained [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   This field contains a wrapped reference to the editor component. The EditorDelegateinner class delegates calls such as isCellEditable() to the component it contains, but also  listens for events that indicate editing has stopped. For the three possible types of editors, a  &#8220;stop event&#8221; from the contained component would be either an action event for text fields, or  an item event for checkboxes and combo boxes.   protected int clickCountToStart   This field stores the value for the clickCountToStart property.   27.2.4.5 Tree and Table Editor Methods  Most of the methods in DefaultCellEditor are implementations of the CellEditor methods. The  only other methods in the DefaultCellEditor class that are new are the methods required to  implement the TableCellEditor and TreeCellEditor interfaces.   public Component getTreeCellEditorComponent(JTree tree,Object value, boolean  isSelected, boolean expanded, boolean leaf, int row)   Returns a valid tree cell editor and is discussed in more detail in Chapter 17.   public Component getTableCellEditorComponent(JTable table, Object value, boolean  isSelected, int row, int column)   Returns a valid table cell editor and is discussed in more detail in Chapter 15.   27.3 Event Utilities  If you extend one of the Swing components to add functionality, or indeed, build your own  component from scratch, you need to handle event listeners for any events you might generate. The  EventListenerList class is designed to aid in that task. This class is similar in many ways to the  AWTEventMulticaster; however, it supports any type of listener and assumes you&#8217;ll use only the  appropriate listeners for a given event type. Unlike the AWT multicaster, it does not assume all of  the listeners support the same events.   The KeyStroke class can also help handle keyboard events. Rather than listening to every key that  gets pressed and throwing out the things you don&#8217;t care about, you can use the KeyStroke class to  register specific actions with specific keys.   27.3.1 The EventListenerList Class  If your component generates events, it must contain methods to add and remove interested listeners.  Following the JavaBeans design patterns, these are the addTypeListener() and  removeTypeListener() methods. Typically you store the listeners in a vector, and then use the  vector as a rollcall for who to send events to when the time comes. This is a very common task for  components that generate events, and the EventListenerList can help lift some (but certainly not  all) of the burden of coding the event firing.   The EventListenerList stores listeners as pairs of objects, one object to hold the listener&#8217;s type  and one to hold the listener itself. At any time, you can retrieve all of the current listeners as an  array of Objects and use that array to fire off any events you need.   - 927     <br />You want to have a cheap webhost for your apache application, then check <a href="http://apache.bluewebsitehosting.net">apache web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/java-swing-ftp-web-hosting-o-reilly-this-field-contains-a/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Web hosting domain names - Java Swing - O Reilly 27.2.4.1 Properties The DefaultCellEditor</title>
		<link>http://www.bluewebsitehosting.net/blue/web-hosting-domain-names-java-swing-o-reilly-27241-properties-the-defaultcelleditor/</link>
		<comments>http://www.bluewebsitehosting.net/blue/web-hosting-domain-names-java-swing-o-reilly-27241-properties-the-defaultcelleditor/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 10:27:46 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/web-hosting-domain-names-java-swing-o-reilly-27241-properties-the-defaultcelleditor/</guid>
		<description><![CDATA[Java Swing - O Reilly   27.2.4.1 Properties  The DefaultCellEditor class contains the properties listed in Table 27.6. The cellEditorValue  property contains the value of the cell editor. This value can be used or ignored when editing stops,  depending on whether editing is stopped or canceled. The clickCountToStart property determines  [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   27.2.4.1 Properties  The DefaultCellEditor class contains the properties listed in Table 27.6. The cellEditorValue  property contains the value of the cell editor. This value can be used or ignored when editing stops,  depending on whether editing is stopped or canceled. The clickCountToStart property determines  how many clicks it takes to begin editing a cell. For checkboxes and combo boxes, that values is 1;  for text fields, the default value of this property is 2, meaning that the user has to double click to  start editing. The component property contains the actual component that the cell editor returns  when getTableCellEditorComponent() or getTreeCellEditorComponent() is called.   Table 27.6, DefaultCellEditor Properties  Property Data Type get is set bound Default Value  cellEditorValue* Object null  clickCountToStart int Determined by constructor  component Component Determined by constructor  27.2.4.2 Events  As dictated by the CellEditor interface, the DefaultCellEditor class implements the add and  remove methods for cell editor listeners. It also provides these convenience methods for generating  those events.   protected void fireEditingStopped()  protected void fireEditingCanceled()   Both of these methods notify registered listeners that editing has stopped. The cell editor is   listed as the source of these events.   27.2.4.3 Constructors  You can create your own cell editor using any of the following constructors. You can pre-configure  any of the components you pass in as well. For example, you might pass in a right-justified text  field or a checkbox with custom icons.   public DefaultCellEditor(JTextField x)  public DefaultCellEditor(JCheckBox x)  public DefaultCellEditor(JComboBox x)   27.2.4.4 Fields  protected EventListenerList listenerList  protected transient ChangeEvent changeEvent   These fields support the cell edit events generated by the editor. The listenerList field  stores the list of all registered listeners interested in hearing about stop or cancel events. The  changeEvent field holds the single change event passed to listeners when events are fired.   protected JComponent editorComponent   This field contains the value for the component property.   protected DefaultCellEditor.EditorDelegate delegate   - 926     <br />Check <a href="http://domain.bluewebsitehosting.net">Tomcat Web Hosting</a> services for best quality webspace to host your web application.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/web-hosting-domain-names-java-swing-o-reilly-27241-properties-the-defaultcelleditor/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Java Swing -  (Business web hosting) O Reilly public abstract boolean isCellEditable(EventObject</title>
		<link>http://www.bluewebsitehosting.net/blue/java-swing-business-web-hosting-o-reilly-public-abstract-boolean-iscelleditableeventobject/</link>
		<comments>http://www.bluewebsitehosting.net/blue/java-swing-business-web-hosting-o-reilly-public-abstract-boolean-iscelleditableeventobject/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 00:15:25 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/java-swing-business-web-hosting-o-reilly-public-abstract-boolean-iscelleditableeventobject/</guid>
		<description><![CDATA[Java Swing - O Reilly   public abstract boolean isCellEditable(EventObject anEvent)   Should return true if anEvent is a valid trigger for starting this kind of editor. For example,  if you want the user to double click on a field to invoke the editor, this method would test  whether anEvent is [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   public abstract boolean isCellEditable(EventObject anEvent)   Should return true if anEvent is a valid trigger for starting this kind of editor. For example,  if you want the user to double click on a field to invoke the editor, this method would test  whether anEvent is a double click mouse event. If it was only a single click, you could  return false. If it was a double click, you could return true.   public abstract boolean shouldSelectCell(EventObject anEvent)   This method should return true if the cell to be edited should also be selected. While you  usually want to select the cell, there are some situations in which not selecting the cell is  preferable. For example, you might be implementing a table that lets the user edit cells that  are part of an ongoing selection. Since you want the selection to remain in place, you would  implement this method to return false. The cell can still be edited.   public abstract boolean stopCellEditing()   public abstract void cancelCellEditing()   You should use these methods to tell the editor to stop editing the cell. The  stopCellEditing() method indicates that editing is over and the new value supplied  should replace the old value of the cell. The cancelCellEditing() method indicates  editing is over and the new value the user entered (if any) should be ignored. The  stopCellEditing() method can return a false value if the editor is unable to stop editing.  (This might occur if your editor validates input and currently contains an invalid entry.) As  an example, you can use these to programmatically stop or cancel editing before starting to  edit another cell or upon losing focus.   27.2.3 The CellEditorListener Interface  The CellEditorListener interface defines how an object can listen for events generated by a cell  editor. Cell editors generate a ChangeEvent when editing is canceled or stopped (a better term  might be &#8220;finished&#8221;). Typically, the object &#8220;hosting&#8221; the editor (for example, a JTree allowing the  user to enter a new filename) would register as a listener. When the event occurs, the JTree would  read the cell&#8217;s new value from the editor, tear down the editor, and repaint the cell with its new  value.   public void editingStopped(ChangeEvent e)   Indicates successful editing has been completed. You can get the new value of the cell from  the editor component, which is contained in the source property of the change event.   public void editingCanceled(ChangeEvent e)   Indicates that editing has been canceled. You should ignore any partially edited value that  might be present in the editor.   27.2.4 The DefaultCellEditor Class  Swing provides a default editor with a fair amount of flexibility. The DefaultCellEditor class  implements the CellEditor interface and provides constructors that let you use a text field, check  box, or combo box for entering the new value.   - 925     <br />You need excellent and relaible webhost company to host your web applications? Then pay a visit to <a href="http://www.wikiwebsitehosting.com">Inexpensive Web Hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/java-swing-business-web-hosting-o-reilly-public-abstract-boolean-iscelleditableeventobject/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Java Swing - O Reilly These overridden Container methods  (Web hosting solutions)</title>
		<link>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-these-overridden-container-methods-web-hosting-solutions/</link>
		<comments>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-these-overridden-container-methods-web-hosting-solutions/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 12:26:09 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-these-overridden-container-methods-web-hosting-solutions/</guid>
		<description><![CDATA[Java Swing - O Reilly   These overridden Container methods ensure the editor pane behaves properly and does not  adversely affect the component using the editor or the editor itself. The paint() and  update() methods are both empty and the documentation states that they should not be  called.   public [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   These overridden Container methods ensure the editor pane behaves properly and does not  adversely affect the component using the editor or the editor itself. The paint() and  update() methods are both empty and the documentation states that they should not be  called.   public void paintComponent(Graphics g, Component c, Container p, Rectangle r)   public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w,int h)  public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w,int h,  boolean shouldValidate)   These methods do the actual work of painting the component c on the graphics context g.  These methods provide the implementation for the methods of the same signatures in the  SwingUtilities class, discussed previously in this chapter. The shouldValidate  parameter determines whether or not c is validated before it is painted. (The first two  methods end up calling the third with a false value for shouldValidate.)   27.2.1.5 Inner Classes  protected class CellRendererPane.AccessibleCellRendererPane extends  AccessibleContext implements Serializable, AccessibleComponent   This class defines the accessible role object for CellRendererPane.   27.2.2 The CellEditor Interface  This interface governs the basic functionality required of an editor. It has methods for retrieving a  new value and determining when to start and stop editing. The basic process for editing is:     The user clicks the required number of times on the cell (varies from editor to editor).    The component (usually JTree or JTable) replaces the cell with its editor.    The user types or chooses a new value.    The user ends the editing session (e.g., hitting enter in a textfield).    The editor fires a change event to interested listeners (usually the tree or table containing the  cell), stating that editing is finished.    The component reads the new value and replaces the editor with the cell&#8217;s renderer.  27.2.2.1 Events  The CellEditor interface requires methods for adding and removing cell editor listeners, which are  objects interested in finding out whether editing is finished or cancelled. The CellEditorListener  class is discussed below.   public abstract void addCellEditorListener(CellEditorListener l)  public abstract void removeCellEditorListener(CellEditorListener l)   27.2.2.2 Methods  public Object getCellEditorValue()   Accesses the only property of a cell editor, which is the cell&#8217;s current value. After successful  editing, a table or tree will call this method to retrieve the new value for the cell.   - 924     <br />You want to have a cheap webhost for your apache application, then check <a href="http://apache.bluewebsitehosting.net">apache web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/java-swing-o-reilly-these-overridden-container-methods-web-hosting-solutions/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Anonymous web server - Java Swing - O Reilly As with all of</title>
		<link>http://www.bluewebsitehosting.net/blue/anonymous-web-server-java-swing-o-reilly-as-with-all-of/</link>
		<comments>http://www.bluewebsitehosting.net/blue/anonymous-web-server-java-swing-o-reilly-as-with-all-of/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 02:08:06 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Blue</category>
		<guid isPermaLink="false">http://www.bluewebsitehosting.net/blue/anonymous-web-server-java-swing-o-reilly-as-with-all-of/</guid>
		<description><![CDATA[Java Swing - O Reilly   As with all of the other Swing components, this method updates the look-and-feel for the   tooltip based on the UIManager.   27.2 Editing and Rendering Utilities  Both the JTree and JTable classes make use of cell renderers to display cells and cell editors to [...]]]></description>
			<content:encoded><![CDATA[<p>Java Swing - O Reilly   As with all of the other Swing components, this method updates the look-and-feel for the   tooltip based on the UIManager.   27.2 Editing and Rendering Utilities  Both the JTree and JTable classes make use of cell renderers to display cells and cell editors to  modify cell values. The CellEditor interface is the basis for these editors, and the  DefaultCellEditor class provides a good implementation of this interface. Unless you&#8217;re doing  something exotic, you should be able to base your cell editors on the DefaultCellEditor class.   27.2.1 The CellRendererPane Class  This utility class was built to keep renderers from propagating repaint() and validate() calls to  the components using renderer components such as JTree and JList. If you played around with  creating your own renderers for any of the Swing components that use them, you&#8217;ll recall that you  did not use this class yourself. Normally this pane is wrapped around the renderer and the  paintComponent() methods below are used to do the actual drawing. Developers will not normally  need to worry about this class.   27.2.1.1 Property  The CellRendererPane has only one property containing its accessible context, shown in Table   27.5.  Table 27.5, CellRendererPane Property   Property Data Type get is set bound Default Value  accessibleContext AccessibleContext CellRendererPane.AccessibleCellRendererPane   27.2.1.2 Field  protected AccessibleContext accessibleContext   This field supports the accessibleContext property.   27.2.1.3 Constructor  This class has only one constructor.   public CellRendererPane()   This constructor creates a new renderer pane that has a null layout and is not initially  visible.   27.2.1.4 Methods  protected void addImpl(Component x, Object constraints, int index)   public void invalidate()  public void paint(Graphics g)  public void update(Graphics g)   - 923     <br />We would like to recommend you tested and proved <a href="http://jboss.solidwebhosting.net">virtual web hosting</a> services, which you will surely find to be of great quality.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.bluewebsitehosting.net/blue/anonymous-web-server-java-swing-o-reilly-as-with-all-of/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
