In JTextArea,what Listener instead of TextArea's addTextListener ()

thank you

DocumentListener. This is in the API,
The java.awt.TextArea could be monitored for changes by adding a TextListener for TextEvents. In the JTextComponent based components, changes are broadcasted from the model via a DocumentEvent to DocumentListeners. The DocumentEvent gives the location of the change and the kind of change if desired. The code fragment might look something like:
DocumentListener myListener = ??;
JTextArea myArea = ??;
myArea.getDocument().addDocumentListener(myListener);
Theres a tutorial that is really helpful.

Similar Messages

  • What listener to use

    what listener do i use when i want have something to happen when i clicked on a jlist other then mouse listener?

    ActionListener

  • What listener do you use for adding text to JTextField?

    what listener do you use for adding text to JTextField?
    I have a component which adds some text to my JTextField, and I want to pick up this event. I have tried ActionListener with no effect.
    cheers,
    Olly

    jtextField.getDocument().addDocumentListener();
    The DocumentListener implements:
    changeUpdate() insertUpdate() removeUpdate().
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/event/DocumentListener.html

  • What Listener to Choose ?

    Hello,
    My situation is as follows:
    I have implemented two InputVerifiers, which tracks whether a valid(not negative, integer, not empty...) number was entered into several text fields.
    Whenever there is an invalid value a warning message displays. That is correct.
    My problem is:
    Concerning the situation described above. If there are not valid values in my text fields and I want to close the window ("Close" button).
    However instead of closing the window, a warning message displays, that the "text field value is invalid". This is not correct. I want to close the window, no matter what values are in the text fields.
    My idea:
    I thought it would be possible to add some listener to the "Close" button, which would set the inputVerifiers of the text fields to null and then, at some other point in the code I would set it back.
    I tried ChangeListener(), however this approach worked pretty strangely for me (Closing the window was OK, but then the warning messages stopped to be displayed at some moment).
    Anybody has any advice for this??
    Thank you very much and wish you a luxurious day:)
    Adam

    Hi Adam,
    You don't need another listener, you could just check if the window should be closed and then call Frame.dispose().
    The InputVerifier method that does the validity check could look like this:
    public void checkInput(/* some parameters*/){
       String input = textField.getText();
       boolean invalidInput = true;
       /*Input validation*/
       if (invalidInput){
           if (closeWindowCondition){
                 window.dispose();
                 return;
           //the window should remain open, just display an error message
           JOptionPane.showMessageDialog(window, "error message", "title");
    }If I understood you correctly that should do it.

  • ComboBoxPopup - what listener is closing the popup?

    Hi,
    I am looking at the ComboBoxPopup...and I am trying to figure out which listener is causing the popup to be hidden when I click somewhere in the popup.
    I have modified the ScrollPane to use my own JPanel instead of a Jlist....so I know its not the list handlers..
    anyone have an idea?
    thanks

    In BasicComboPopup, look for this line:
    protected class ListMouseHandler extends MouseAdapter {
    "This listener hides the popup when the mouse is released in the list."
    Also,:
    protected class InvocationMouseHandler extends MouseAdapter {
    And in BasicComboBoxUI:
    public class FocusHandler implements FocusListener {
    The "setPopupVisible()" calls.

  • Difference between JTextArea and TextArea

    hi,
    what the difference betwween the two lines:
    JTextArea area = new JTextArea (10,20);
    and
    TextArea t2 = new TextArea("compilation",4,30,TextArea.SCROLLBARS_BOTH);     
    and what means numbers 10,20 for these lignes.
    bes regards.
    jihen.

    The major difference between the two classes is that JTextArea is Swing based and TextArea is AWT based. JTextArea is more efficient. In AWT, each component established a peer in the OS (think of them as all being viewed as a window in the OS). So as far as the OS was concerned, a window was a window, a button was a window, text area was a window, etc.
    This is why you will often see AWT components referred to as heavy components. Swing components, on the other hand, are often referred to as lightweight components. This is because only the top level components are heavy. This means think like JFram, JWindow, etc. still establish a peer in the OS (so the OS sees them as windows). The other components in Swing (JButton, JTextArea, etc.) are actually drawn onto the top level component's peer.
    So, in AWT, if you created 1 Frame with 2 TextArea components and 1 Button, 4 peers would be created in the OS (lots of resources). In Swing, the same combination would result in 1 peer (for the JFrame). The 2 JTextArea compoonents and the JButton would simply be drawn graphically on the JFrame's peer (resulting in a significant resource saving).
    One last point; you'll notice the Swing components are named J+OldAWTName. So the AWT Button is JButton in Swing. Be sure never to mix the two typs. You most code all AWT or all Swing. Exceptions and Events are not included in this restriction since there is no "visual" representation of these classes (they are just basic JavaBean classes).
    Hope this gets you started.

  • What's listening on port 454 and 455 in Azure? Warning flagged by security scan

    We are about to go live with an Azure Website and, as a precaution, did a security scan on the IP address that has been allocated to us.
    There were a number of low severity warnings listed which we're not too worried about, however the scan did flag that something appears to be listening on port 454 and 455, and supports TLS1.0.
    RESULTS:
    Available non CBC cipher Server's choice SSL version
    RC4-SHA DES-CBC3-SHA TLSv1
    Does anyone know what this is? I can't find it obviously listed anywhere. If it's not necessary, can I switch it off? And if it is necessary, can I set it to require a more secure protocol?
    We're hosted in the "Australia East" datacentre, in case that's relevant.
    Crossposted to Stack Overflow here:
    http://stackoverflow.com/questions/27807505/whats-listening-on-port-454-and-455-in-azure-warning-flagged-by-security-scan

    Hello Michael,
    These ports are used for internal communication in Azure Websites infrastructure. They are not site specific and you cannot turn them off. It is safe to ignore them.
    Thanks,
    Petr

  • What is a Listener

    Do anyone in here know whats Listener? I would like to know
    more about it.

    evomind,
    > Do anyone in here know whats Listener? I would like to
    > know more about it.
    A listener is a concept -- just one way to handle an event
    in
    ActionScript. In ActionScript 2.0, for example, you could use
    a listener
    like this:
    var listener:Object = new Object();
    listener.onKeyUp = function():Void {
    trace("A key has been pressed");
    Key.addListener(listener);
    The variable, listener, is named arbitrarily. It could be
    "monkeys," if
    you like -- but "listener" makes sense, because that's what
    this object is
    doing. It's "listening" for an onKeyUp event on behalf of the
    Key class, to
    which that event actually belongs.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • To limit number of chracters in textarea.

    hello all,
    please find below a small program to demonstrate how to limit number of charcaters in a textarea.
    i searchedthe forum and i actually got the technique from the forum. but when i put together a sa program it does not work.
    could anyone point out what is the problem in the small piece of code below.
    i am working on jdk 1.2.1
    thanx to all.
    // Example illustrating Limiting number of characters in text area.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class try1 extends JApplet {
    Container contentPane;
    JLabel label;
    JTA1 textarea;
    public void init() {
    // Get the handle on the applet's content pane.
         contentPane = this.getContentPane();
    // Create a text field and add a key listener to it.
         textarea = new JTA1(25);           // of 25 char width
    // Create a button object and register an action listener
         Button button = new Button("Clear");
         button.addActionListener(new ButtonListener());
    // Create a label with the titled border.
         label = new JLabel("Key Typed: NiL");
         label.setBorder(BorderFactory.createTitledBorder
    ("You pressed the Following Key"));
    // Add the text field and button to the applet's content pane.
         contentPane.setLayout(new BorderLayout());
         contentPane.add("North", textarea);
         contentPane.add(label);
         contentPane.add("South", button);
    // Get focus on text field.Note: You can do this only after you add the text field to the container
    class ButtonListener implements ActionListener {     // Create the button listener class.
         public void actionPerformed(ActionEvent e)      {
    // Reset the text components
         textarea.setText("");
    //Return the focus to the text field.
    class JTA1 extends JTextArea
         private int limit;
         public JTA1 ( int limit )
              this.limit = limit;
              addKeyListener( new LimitListener() );     
         class LimitListener extends KeyAdapter
              public void keyPressed( KeyEvent ke )
                   if( getText().trim().length() >= limit )
                   {     ke.consume(); //just consume KeyEvent

    Don't cross post. This question has been answered in your other post.

  • Problem on Swing TextArea

    I want to display characters in TextArea with Upper case only. If customer input some data in a TextArea, by default the entered data should appear in Upper Case only in the TextArea, incase user enters in Lower case also. Can anyone please provide me a solution to my problem.
    Thanks

    Thanks alot its working with your solution. One more question What listener is used for JTextArea? for AWT TextArea, there is a textlistener, and writing code in textValuechanged() method, like this is there any way for JTextArea in Swings.
    Thanks for your help,

  • What should I use about my editor

    What is the best TextArea class to use about my editor?
    I am using JTextArea but when I save the text from it, the new line is not recognized with other editors.
    Any suggestion how to fix this problem?

    Well I am using this method to save the text from the text area
    BufferedWriter out = new BufferedWriter(new FileWriter(filePath));
                   out.write(text);
    where text is jtextarea.getText();
    I think if i use TextArea instead of JTextArea, i wouldn't have this poblem but TextArea has less methods than JTextArea

  • Read from text file, display in textarea

    java newbie here - I'm trying to write a chat program that checks a text file every 1 second for new text, and then writes that text to a textArea. I've got the thread setup and running, and it checks and text file for new text - all that works and prints to system console - but I have no idea how to print that text to a textArea.
    I've tried textArea.append, but it seems this only works on the initial run - if I put it in the thread, it won't work. I can make textArea.append work if its in an ActionEvent - but how would I make an ActionEvent run only when my script detects new text from my text file?
    Any ideas on how to do this are appreciated.
    --Mike                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I've tried textArea.append, but it seems this only works on the initial
    run - if I put it in the thread, it won't work. I can make textArea.append
    work if its in an ActionEvent - but how would I make an ActionEvent
    run only when my script detects new text from my text file? ?
    It doesn't matter if you call the textArea.append() when the ActionEvent is triggered or if you call textArea.append() directly from a thread or any other object, the text will be append to te text area. What could have happen is you somehow lost the reference pointing to the textArea that you add to your user interface.
    example:
    JTextArea txtArea = blah..blah..blah
    MyThread t = new myThread(txtArea);
    class MyThread extends Thread{
        private JTextArea txtArea;
        public MyThread(Thread textArea){
            this.textArea = textArea;
        public void run(){
            textArea = new JTextArea(); // opps..you lost the reference to the textArea in the main gui...what you have done is created a new JTextArea object and point to tat..and this textarea object is not visible.
    }

  • Huge performance differences between a map listener for a key and filter

    Hi all,
    I wanted to test different kind of map listener available in Coherence 3.3.1 as I would like to use it as an event bus. The result was that I found huge performance differences between them. In my use case, I have data which are time stamped so the full key of the data is the key which identifies its type and the time stamp. Unfortunately, when I had my map listener to the cache, I only know the type id but not the time stamp, thus I cannot add a listener for a key but for a filter which will test the value of the type id. When I launch my test, I got terrible performance results then I tried a listener for a key which gave me much better results but in my case I cannot use it.
    Here are my results with a Dual Core of 2.13 GHz
    1) Map Listener for a Filter
    a) No Index
    Create (data always added, the key is composed by the type id and the time stamp)
    Cache.put
    Test 1: Total 42094 millis, Avg 1052, Total Tries 40, Cache Size 80000
    Cache.putAll
    Test 2: Total 43860 millis, Avg 1096, Total Tries 40, Cache Size 80000
    Update (data added then updated, the key is only composed by the type id)
    Cache.put
    Test 3: Total 56390 millis, Avg 1409, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 4: Total 51734 millis, Avg 1293, Total Tries 40, Cache Size 2000
    b) With Index
    Cache.put
    Test 5: Total 39594 millis, Avg 989, Total Tries 40, Cache Size 80000
    Cache.putAll
    Test 6: Total 43313 millis, Avg 1082, Total Tries 40, Cache Size 80000
    Update
    Cache.put
    Test 7: Total 55390 millis, Avg 1384, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 8: Total 51328 millis, Avg 1283, Total Tries 40, Cache Size 2000
    2) Map Listener for a Key
    Update
    Cache.put
    Test 9: Total 3937 millis, Avg 98, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 10: Total 1078 millis, Avg 26, Total Tries 40, Cache Size 2000
    Please help me to find what is wrong with my code because for now it is unusable.
    Best Regards,
    Nicolas
    Here is my code
    import java.io.DataInput;
    import java.io.DataOutput;
    import java.io.IOException;
    import java.util.HashMap;
    import java.util.Map;
    import com.tangosol.io.ExternalizableLite;
    import com.tangosol.net.CacheFactory;
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.Filter;
    import com.tangosol.util.MapEvent;
    import com.tangosol.util.MapListener;
    import com.tangosol.util.extractor.ReflectionExtractor;
    import com.tangosol.util.filter.EqualsFilter;
    import com.tangosol.util.filter.MapEventFilter;
    public class TestFilter {
          * To run a specific test, just launch the program with one parameter which
          * is the test index
         public static void main(String[] args) {
              if (args.length != 1) {
                   System.out.println("Usage : java TestFilter 1-10|all");
                   System.exit(1);
              final String arg = args[0];
              if (arg.endsWith("all")) {
                   for (int i = 1; i <= 10; i++) {
                        test(i);
              } else {
                   final int testIndex = Integer.parseInt(args[0]);
                   if (testIndex < 1 || testIndex > 10) {
                        System.out.println("Usage : java TestFilter 1-10|all");
                        System.exit(1);               
                   test(testIndex);               
         @SuppressWarnings("unchecked")
         private static void test(int testIndex) {
              final NamedCache cache = CacheFactory.getCache("test-cache");
              final int totalObjects = 2000;
              final int totalTries = 40;
              if (testIndex >= 5 && testIndex <= 8) {
                   // Add index
                   cache.addIndex(new ReflectionExtractor("getKey"), false, null);               
              // Add listeners
              for (int i = 0; i < totalObjects; i++) {
                   final MapListener listener = new SimpleMapListener();
                   if (testIndex < 9) {
                        // Listen to data with a given filter
                        final Filter filter = new EqualsFilter("getKey", i);
                        cache.addMapListener(listener, new MapEventFilter(filter), false);                    
                   } else {
                        // Listen to data with a given key
                        cache.addMapListener(listener, new TestObjectSimple(i), false);                    
              // Load data
              long time = System.currentTimeMillis();
              for (int iTry = 0; iTry < totalTries; iTry++) {
                   final long currentTime = System.currentTimeMillis();
                   final Map<Object, Object> buffer = new HashMap<Object, Object>(totalObjects);
                   for (int i = 0; i < totalObjects; i++) {               
                        final Object obj;
                        if (testIndex == 1 || testIndex == 2 || testIndex == 5 || testIndex == 6) {
                             // Create data with key with time stamp
                             obj = new TestObjectComplete(i, currentTime);
                        } else {
                             // Create data with key without time stamp
                             obj = new TestObjectSimple(i);
                        if ((testIndex & 1) == 1) {
                             // Load data directly into the cache
                             cache.put(obj, obj);                         
                        } else {
                             // Load data into a buffer first
                             buffer.put(obj, obj);                         
                   if (!buffer.isEmpty()) {
                        cache.putAll(buffer);                    
              time = System.currentTimeMillis() - time;
              System.out.println("Test " + testIndex + ": Total " + time + " millis, Avg " + (time / totalTries) + ", Total Tries " + totalTries + ", Cache Size " + cache.size());
              cache.destroy();
         public static class SimpleMapListener implements MapListener {
              public void entryDeleted(MapEvent evt) {}
              public void entryInserted(MapEvent evt) {}
              public void entryUpdated(MapEvent evt) {}
         public static class TestObjectComplete implements ExternalizableLite {
              private static final long serialVersionUID = -400722070328560360L;
              private int key;
              private long time;
              public TestObjectComplete() {}          
              public TestObjectComplete(int key, long time) {
                   this.key = key;
                   this.time = time;
              public int getKey() {
                   return key;
              public void readExternal(DataInput in) throws IOException {
                   this.key = in.readInt();
                   this.time = in.readLong();
              public void writeExternal(DataOutput out) throws IOException {
                   out.writeInt(key);
                   out.writeLong(time);
         public static class TestObjectSimple implements ExternalizableLite {
              private static final long serialVersionUID = 6154040491849669837L;
              private int key;
              public TestObjectSimple() {}          
              public TestObjectSimple(int key) {
                   this.key = key;
              public int getKey() {
                   return key;
              public void readExternal(DataInput in) throws IOException {
                   this.key = in.readInt();
              public void writeExternal(DataOutput out) throws IOException {
                   out.writeInt(key);
              public int hashCode() {
                   return key;
              public boolean equals(Object o) {
                   return o instanceof TestObjectSimple && key == ((TestObjectSimple) o).key;
    }Here is my coherence config file
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>test-cache</cache-name>
                   <scheme-name>default-distributed</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>          
              <distributed-scheme>
                   <scheme-name>default-distributed</scheme-name>
                   <backing-map-scheme>
                        <class-scheme>
                             <scheme-ref>default-backing-map</scheme-ref>
                        </class-scheme>
                   </backing-map-scheme>
              </distributed-scheme>
              <class-scheme>
                   <scheme-name>default-backing-map</scheme-name>
                   <class-name>com.tangosol.util.SafeHashMap</class-name>
              </class-scheme>
         </caching-schemes>
    </cache-config>Message was edited by:
    user620763

    Hi Robert,
    Indeed, only the Filter.evaluate(Object obj)
    method is invoked, but the object passed to it is a
    MapEvent.<< In fact, I do not need to implement EntryFilter to
    get a MapEvent, I could get the same result (in my
    last message) by writting
    cache.addMapListener(listener, filter,
    true)instead of
    cache.addMapListener(listener, new
    MapEventFilter(filter) filter, true)
    I believe, when the MapEventFilter delegates to your filter it always passes a value object to your filter (old or new), meaning a value will be deserialized.
    If you instead used your own filter, you could avoid deserializing the value which usually is much larger, and go to only the key object. This would of course only be noticeable if you indeed used a much heavier cached value class.
    The hashCode() and equals() does not matter on
    the filter class<< I'm not so sure since I noticed that these methods
    were implemented in the EqualsFilter class, that they
    are called at runtime and that the performance
    results are better when you add them
    That interests me... In what circumstances did you see them invoked? On the storage node before sending an event, or upon registering a filtered listener?
    If the second, then I guess the listeners are stored in a hash-based map of collections keyed by a filter, and indeed that might be relevant as in that case it will cause less passes on the filter for multiple listeners with an equalling filter.
    DataOutput.writeInt(int) writes 4 bytes.
    ExternalizableHelper.writeInt(DataOutput, int) writes
    1-5 bytes (or 1-6?), with numbers with small absolute
    values consuming less bytes.Similar differences exist
    for the long type as well, but your stamp attribute
    probably will be a large number...<< I tried it but in my use case, I got the same
    results. I guess that it must be interesting, if I
    serialiaze/deserialiaze many more objects.
    Also, if Coherence serializes an
    ExternalizableLite object, it writes out its
    class-name (except if it is a Coherence XmlBean). If
    you define your key as an XmlBean, and add your class
    into the classname cache configuration in
    ExternalizableHelper.xml, then instead of the
    classname, only an int will be written. This way you
    can spare a large percentage of bandwidth consumed by
    transferring your key instance as it has only a small
    number of attributes. For the value object, it might
    or might not be so relevant, considering that it will
    probably contain many more attributes. However, in
    case of a lite event, the value is not transferred at
    all.<< I tried it too and in my use case, I noticed that
    we get objects nearly twice lighter than an
    ExternalizableLite object but it's slower to get
    them. But it is very intersting to keep in mind, if
    we would like to reduce the network traffic.
    Yes, these are minor differences at the moment.
    As for the performance of XMLBean, it is a hack, but you might try overriding the readExternal/writeExternal method with your own usual ExternalizableLite implementation stuff. That way you get the advantages of the xmlbean classname cache, and avoid its reflection-based operation, at the cost of having to extend XMLBean.
    Also, sooner or later the TCMP protocol and the distributed cache storages will also support using PortableObject as a transmission format, which enables using your own classname resolution and allow you to omit the classname from your objects. Unfortunately, I don't know when it will be implemented.
    >
    But finally, I guess that I found the best solution
    for my specific use case which is to use a map
    listener for a key which has no time stamp, but since
    the time stamp is never null, I had just to check
    properly the time stamp in the equals method.
    I would still recommend to use a separate key class, use a custom filter which accesses only the key and not the value, and if possible register a lite listener instead of a heavy one. Try it with a much heavier cached value class where the differences are more pronounced.
    Best regards,
    Robert

  • ORA-12518: TNS:listener could not hand off client connection

    guys,
    i have a problem here with the connection between a client host and a server database, using a new non-default listener LISTENER_BKP_1. The error showed is:
    ORA-12518: TNS:listener could not hand off client connection
    i had learned about this error here before, and i toke some notes as follows:
    h2. listener.log
    TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-SEP-2009 01:23:49
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    System parameter file is C:\oracle\product\10.2.0\db_2\network\admin\listener.ora
    Log messages written to C:\oracle\product\10.2.0\db_2\network\log\listener_bkp_1.log
    Trace information written to C:\oracle\product\10.2.0\db_2\network\trace\listener_bkp_1.trc
    Trace level is currently 0
    Started with pid=2212
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=WINXP)(PORT=1523)))
    Listener completed notification to CRS on start
    TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
    25-SEP-2009 01:24:39 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=PAULO))(COMMAND=services)(ARGUMENTS=64)(SERVICE=listener_bkp_1)(VERSION=169869568)) * services * 0
    25-SEP-2009 01:24:49 * (CONNECT_DATA=(SERVICE_NAME=financeira.winxp)(CID=(PROGRAM=C:\ORACLE?instantclient_10_2\sqlplus.exe)(HOST=PAULO_NOTEBOOK)(USER=ORACLE_DBA))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.100)(PORT=51649)) * establish * financeira.winxp * 12518
    TNS-12518: TNS:listener could not hand off client connection
    TNS-12560: TNS:protocol adapter error
    TNS-00530: Protocol adapter error
    32-bit Windows Error: 2: No such file or directory
    25-SEP-2009 01:24:53 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=PAULO))(COMMAND=services)(ARGUMENTS=64)(SERVICE=listener_bkp_1)(VERSION=169869568)) * services * 0
    h2. lsnrctl services
    C:\>lsnrctl services listener_bkp_1
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-SEP-2009 01:33:40
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=WINXP)(PORT=1523)))
    Services Summary...
    Service "FINANCEIRA.WINXP" has 1 instance(s).
    Instance "FINANCEI", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:1
    LOCAL SERVER
    The command completed successfully
    h2. listener.ora file
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = FINANCEIRA.WINXP)
    (SID_NAME = FINANCEI)
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = WINXP)(PORT = 1521))
    SID_LIST_LISTENER_BKP_1 =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = FINANCEIRA.WINXP)
    (SID_NAME = FINANCEI)
    LISTENER_BKP_1 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = WINXP)(PORT = 1523))
    h2. v$resource_limit
    RESOURCE_NAME ; CURRENT_UTILIZATION ; MAX_UTILIZATION ; INITIAL_ALLOCATION ; LIMIT_VALUE
    processes ; 26 ; 30 ; 150; 150
    sessions ; 30 ; 35 ; 170 ; 170
    2 rows selected
    this means that it didn't reach the resource limites yet. What i can do to solve the problem ???
    another important information is that connecting by the default listener LISTENER instead of the LISTENER_BKP_1 listener, the connection is completed successfully. There's enough SGA memory space too.
    Tks,

    Paulo_BR wrote:
    i have a problem here with the connection between a client host and a server database, using a new non-default listener LISTENER_BKP_1. The error showed is:
    ORA-12518: TNS:listener could not hand off client connectionDon't do Oracle on Windows, so I'm not sure how the following relates to the Listener dealing with a dedicated server connection request on Linux/Unix.
    On Linux/Unix, a dedicated server request means just that - a dedicated process has to be started to service that client. The Listener does it by using the parameters of the configured listener.ora service to execute +$ORACLE_HOME/bin/oracle+. This process then starts up, and the Listener hands off the client connection for this process for servicing.
    If there is a failure somewhere on this series of steps fail, the Listener throws the ORA-12518 exception. For example, the +$ORACLE_HOME+ has been incorrectly configured in listener.ora and it fails to execute and startup a dedicated server process.
    And this relates to the underlying error you are seeing:
    TNS-12518: TNS:listener could not hand off client connection
    TNS-12560: TNS:protocol adapter error
    TNS-00530: Protocol adapter error
    32-bit Windows Error: 2: No such file or directoryI think that the Listener on Windows uses the CreateRemoteThread() Win32 call to start up the server process thread. However, it needs a valid process identifier (of the existing Oracle instance) for this call - and thus needs to first identify the Oracle instance process. Could be that this step uses a ORACLE_HOME reference. And if that directory path is not valid, it is unable to identify the process id of the Oracle instance and thus unable to spawn a dedicated thread to service that client.

  • Printing a TextArea. PLEASE HELP ME! :)

    I'm trying to use this code for printing the content of a TextArea:
    void Stampare(){   
    PrinterJob printJob = PrinterJob.getPrinterJob();
    Book book = new Book();
    PageFormat documentPageFormat = new PageFormat();
    documentPageFormat.setOrientation(PageFormat.LANDSCAPE);
    book.append(new Document(), documentPageFormat);
    printJob.setPageable(book);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    catch (Exception PrintException){
    PrintException.printStackTrace();
    public class Document implements Printable {
    private final static int POINTS_PER_INCH = 72;
    public int print (Graphics g, PageFormat pageFormat, int page) {
    Graphics2D g2d = (Graphics2D) g;
    g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    g2d.setPaint(Color.black);
    g2d.setStroke(new BasicStroke (4));
    Rectangle2D.Double border = new Rectangle2D.Double (0, 0, pageFormat.getImageableWidth (), pageFormat.getImageableHeight ());
    //g2d.draw(border);
    String text = new String(areaStampa.getText());
    Point2D.Double pen = new Point2D.Double(0.25 * POINTS_PER_INCH, 0.25 * POINTS_PER_INCH);
    double width = 7.5 * POINTS_PER_INCH;
    AttributedString paragraphText = new AttributedString(text);
    paragraphText.addAttribute(TextAttribute.FONT, new Font("serif", Font.PLAIN, 12));
    LineBreakMeasurer lineBreaker = new LineBreakMeasurer(paragraphText.getIterator(), new FontRenderContext(null, true, true));
    TextLayout layout;
    while ((layout = lineBreaker.nextLayout((float) width)) != null){
    pen.y += layout.getAscent();
    layout.draw(g2d, (float) pen.x, (float) pen.y);
    pen.y += layout.getDescent() + layout.getLeading();
    return (PAGE_EXISTS);
    Obviuosly, it doesn't work as I would like it to do!
    First of all, It doesn't print the lines as they are in the TextArea. I mean, the carriage returns are not the one that are in the TextArea.
    Secondly, If there's a lot of text, It does exactly nothing! My purpose is to print pages as if they were a Word document, while here it seems that I cannot print more than a page.
    Please, please, please, help me!!!! I'm becoming crazy with this problem!
    Thanks a lot,
    Giorgio

    I really need somebody who could give me the correct version of this application. Have you ever developed an application that uses a TextArea (or a JTextArea, if it is possible to use that) exactly as it was a Word document? I mean, something that would let you print what is inside the TextArea as if it was inside a Word document, with more than one page, all the lines printed correctly and so on. If you have that, please, please, please!!! send me a copy. My e-mail address is [email protected]
    I would really, really appreciate that!
    Thanks,
    Giorgio

Maybe you are looking for

  • Unable to capture field values in Master agreement  Line Items

    I am trying to get the field values from master agreement line items page. I have written the following code to get the line item details which is working fine to capture part number and quantity-> agreementBean = doc.getRootParentIBean(); lineItemCo

  • How can I download a video from a trusted site two minutes in length ?

    How can I upload a video from a trusted site to an installed version of Adobe Flash Player ? What is involved in downloading a two minute government promotional video for a travel destination ?

  • XSLT with RTF

    Anyone written out a table of contents before with XSLT & xml. I have a document with many sections, want a TOC entry for each section for some reason this code does not work properly no output. But if i take away the tc & tcn tags it prints out the

  • Minor problem with protective c

    Ok so I recently purchased the Creative Zen Vision M Mp3 player. It's great so far and I have no real complaints about it at all, well at least not yet, but I think i'll love this player once I get used to it. By the way the touch pad isn't as bad as

  • Oracle lite with JDBC crashes

    I am connecting to an Oracle lite database on NT Server 4.0 with JDBC and trying to run an simple insert statement. If I try to run the same statement again (which should throw an exception since the pk already exists) I get an application error - no