Selecting in Non-Editable JTextField in JDK 1.4

Hi.
Posting as new thread - maybe somebody can help.
I want a formatted non-editable (!) display component (for incoming Instant Messages, if anyone cares), which allows selecting with the mouse (including selection highlighting) and then copying FROM it into another application or window. Currently (starting from JDK 1.4), this does not appear to be possible with a JTextArea. It works absolutely fine in all 1.3 JDKs, so It appears it was broken starting with JDK 1.4.
Imagine not being able to copy FROM your Web browser (which is non-editable) INTO another application. That's what the situation is currently like.
So - maybe I'm missing the obvious (well, a setSelectable(true) method would probably be TOO obvious), but can anyone help me as to how I can achieve the desired effect.
From how I understood the workarounds in another thread, they would mean actually making the TextPane editable, but preventing all edits. Oh, and manually making its appearance resemble a non-editable Pane, so that the GUI doesn't appear inconsistent. SURELY this cannot be reasonable.
Thanks,
Daniel.

Hi!
I managed to boil the problem down to a simple test case (and, in doing so, actually found a fix for our problem). It seems that JTextPane does not allow selection if the method isFocusTraversable (which, by the way, is deprecated in JDK 1.4) is overridden:
import java.awt.*;
import javax.swing.*;
public class test
extends JDialog
     public test()
          super((JFrame)null, "JTextPane Test");
          getContentPane().setLayout(new BorderLayout());
          JTextPane pane = new JTextPane()
// public boolean isFocusTraversable()
// return false;
          String s1 = "01234567890123456789012345678901234567890123456789";
          String s2 = "";
          for (int i=0;i<50;i++)
          s2 = s2+s1+"\n";
          pane.setText (s2);
          pane.setEditable(false);
          getContentPane().add(new JScrollPane(pane), BorderLayout.CENTER);
          pack();
     public static void main(String argv[])
          (new test()).show();
If you remove the comment lines around the inner class method, selection stops working. If you leave the comments in, selection and copy/paste do indeed work.
Now why, one wonders, does a method which is deprecated in JDK 1.4 actually cause a PROBLEM in JDK 1.4 that wasn't there before?
Daniel.

Similar Messages

  • Selection-screen non-editable field

    HI,
      On the selection-screen of a report, i have 2 parameter & one select opttions in selection screen like this sequence
        p1 (has F4 help)
        s1
        p2 (Mandatory field)
       If i select p1 value 'create' from F4 help. then depends on this selection  from F4 help
          s1 should be editiable.
          p2 should be non-editable.
      If i select p1 value 'dispaly' from F4 help. then depends on this selection from F4 help
          s1 should be editiable.
          p2 should be editable.
    How to acheive this.

    Try this
    tables: vbrk.
    parameters:  s_bukrs like vbrk-bukrs,
                 s_fkart like vbrk-fkart,
                 s_fktyp like vbrk-fktyp.
    at selection-screen output.
      loop at screen.
        if screen-name = 'S_FKART' .
          screen-input = 0.
          modify screen.
        endif.
        if screen-name = 'S_FKTYP' .
          screen-input = 0.
          modify screen.
        endif.
        if s_bukrs = '<your f4 input value> '.
          screen-input = 1.
          modify screen.
        endif.
        endloop.

  • Multiple instances of same component become non-editable

    I have created a simple component for authors to add links. They enter anchor text, link destination, title attribute, via textfield. They set the target attribute via a dropdown list, xtype=selection. The issue we run into, is that if the author has entered multiple instances of the same component on a page, the dropdowns become non-editable after they are set the first time. They cannot be edited changed until the page edit view/content finder is closed and reopened.
    Scenario:
    1. User drag/drops component
    2. User makes selection from dropdown xtype=selection
    3. User drag/drops same component again to allowed parent
    4. User make selection from dropdown xtype=selection in second instance of component
    5. User can no longer change the selection in either instance of the component without closing and reopening edit view/content finder.
    6. User closes and reopens edit view/content finder.
    7. Again, both instances of the dropdown xtype=selection become non-editable after first selection of an option until the edit view/content finder is closed and reopened.
    When there is only one instance of the component on the page, the drop downs/xtype=select remain editable at all times.
    In addition to this particular scenario, I've had to work around some other issues of multiple instances of a component, where only one instance on a page works at all, the data gets crossed/jumbled between instances of the same component, etc.
    My question is first, how might I solve for the scenario fully called out in this question? Secondly, is there some methodology to making multiple instances of the same component track themselves individually, work together on the same page, play nicely with each other?
    Any assistance is appreciated.

    Using request scope would be a workaround.
    I'm looking for view distinct state for the associated component tree for the session (i.e. managed bean state, whether its separate instances of the bean or copies of serialized state I don't care)
    My views require conversational-like state handling that I don't want stored on the client.

  • FBL5N - Feild selection non editable mode

    Hi All,
    When i execute FBL5N transaction,i am not able to select the feilds as per my desire bcoz the feild display ICON is in non editable mode.
    The only option i have is layout selection and not the feilds selection.
    Can you let me know how to change it to editable mode.
    regards

    Hello,
    You don't have authorization for maintain ALV layouts. Please contact to your Basis department for authorization.
    ALV layout authorization object is S_ALV_LAYO. Please tell your Basis departman to give this object value for '23'.
    Regards,
    Burak

  • Selection screen in Non-EDIT mode

    Hi all,
    I have a selection screen in which the user wants a field to be in Non-EDIT mode. How to do it?
    PARAMETERS : s_vkorg like vbrk-vkorg default '1000'.
    (The above parameter shud be in non-editable mode) 
    select-options : s_vtweg for vbrk-vtweg.
    select-options : s_spart for vbrk-spart.
    Pls reply.
    Thanks in advance.
    Vijay

    Vijay,
    Use the code below.
    REPORT zscreen.
    TABLES: vbrk.
    SELECT-OPTIONS : s_vtweg FOR vbrk-vtweg MODIF ID mo1.
    SELECT-OPTIONS : s_spart FOR vbrk-spart MODIF ID mo1.
    * At selection Screen Output Event
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'MO1'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.

  • Changing JList non-editable Font color of the selected items

    Hi All,
    I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.
    Could you please clarify me?
    <img src="file:///C:/DOCUME~1/sgnanasi/LOCALS~1/Temp/moz-screenshot-4.png" alt="" />

    [email protected] wrote:
    ..I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.Set a custom [cell renderer|http://java.sun.com/javase/6/docs/api/javax/swing/ListCellRenderer.html] *(<- link)* for the JList.

  • Setting Non-Editable property for selected Rows in jTable

    Hi,
    I want particular rows to be set non-editable within a jTable. For example. If I have seven rows as follows:
    1
    2 - (Non-editable)
    3
    4
    5 - (Non-editable)
    6
    7
    I want to set non-Editable property to the second & Fifth Rows(say) alone. Other Rows, I may edit.
    How can I do this?
    Thanks in adv.

    TableModel has method
    boolean isCellEditable(int rowIndex,
    int columnIndex)
    so you need to make your table model return false for these rows.

  • How do I save a PDF as non-editable?

    I have a form that I filled out with Adobe Professional 7.0. What options do I select to make sure it saves as non-editable? Thanks for any help.

    Hey David, add some security to it. You can even keep people from printing it if you want to, or even need a password to open it.
    J.R.

  • Make the 'ASSIGNMENT FIELD' of particular financial Doc type non-editable

    Hi Experts,
    We have an done an Z development, where we are populating critical data in the 'ASSIGNMENT FIELD OF gl account' of a newly created  financial document type (ZD).This document is created through BAPI.
    Now our requirment is to make this 'Assignment field' non-editable .
    Thanks & Regards,
    Vishal

    Go to OB32
    Select Account type and select table with field name ZUONR and double click
    Uncheck the check box Field can be changed
    Srinivas

  • Making particular rows as non editable before displaying the TABLE

    Hi everyone,
                               I would like to know how to make a particular rows as non editable in UI element "TABLE" before it is displayed . The scenario is :
    On entering the Personnel number, I am getting family dependants in the table. Then, I am selecting any of the family members on some condition and saving each member with the request.
    Next time when i enter the same personnel number, I would like to show the table with already saved request for the family members rows as non editable & other members row as editable.????
    Please provide a feasible solution.

    Hi Pradeep,
    follow as per suggested. if not work use cell variants concept. it will work.
    Please check this wiki...
    http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproforABAPCellVariants
    Cheers,
    Kris.

  • How to made Qty field as non editable in MIRO

    Hi SAP Gurus,
    While Post a Goods Receipt (MIRO) for Receive the Material from Job
    Worker, the Qty of Raw Material which needs to Issue or consume from
    Stock will propose as per PO BOM. The Qty field of Raw Material is in
    Editable Mode. Business wants that Qty Field to be Non-editable and not
    to allow user to Change the Proposed Qty. As per PO BOM and based on
    Material Received from Job Worker, Raw Material has to Issue or Consume
    from Stock. If any Under Consumption or Over Consumption will be
    adjusted thru MB04.
    Pls let me know is there any setting to make Raw Material Qty field as
    non editable.
    Thanks & Regards
    Sathish
    Ph:9940518715

    Hi,
    There is no field selection in MIRO.
    USE SHD0 and create a screen variant
    Thanks & regards,
    Kiran

  • PO order confirmation maked field Non editable

    Dear All,
    We had just shifted to ECC 6.0. When we create the PO and after that enter the order acknowledegement in confirmation Tab the field like PR, Contract Numebr on line item gets grayed out meand non editable. WHile I had tested the same thing in 4.6C and found that in this version although we enter the Order Acknowledegement in COnfiramtion tab and save the PO the field like PR, Contact number at line item does not get garyed out means it is available for editing also.
    Please let me know is there is any settings in Configuration to be done. Or is this is STandard FUnctionality of ECC 6.0. Are there any notes or FAQ notes available on this which states this functionality.
    Please reply as earliest as possible.
    Thanks
    Shashi

    Hi ,
    Spro  - Materials Management - Purchasing - Define Screen Layout at document level - ME21 - Create Purchase order - Field Selection key
    Thanks & Regards,
    Senthil.

  • Payment block non editable on the basis of company code level

    Dear Gurus,
    we had made payment block "A" non editable in payment praposal through transaction code ob27.as per reqeust from
    our partent company in India but our subsidiary in France wants the payment block "a"  to be editable (to be insert
    payment block "a" in document to make document deselect). Is it possible to make payment block editable on the basis of
    company code level.
    Regards,
    Rajesh

    Hi,
    In this scenario, you need to have a NEW Payment block key like Z. Create Z with reference to A in OB27.
    For Z, you need to select check box Change in Payment Proposal and SAVE.
    Now maintain this Z in vendor masters of company code, where you want the payment block can be edited.
    Note: Payment Block codes are not company code dependent.
    Regards,
    SRinu

  • Purchase order Field LIke Material , Non editable by using Trax code Me22n

    Guru
    How to make Purchase order Field LIke Material , Non editable by using Trax code Me22n
    Thanks

    Hi
    Check this in SPRO- SAP IMG- Material Management - Purchasing- Purchase order- Define screen lay out at document level
    In this select the particular field selection key and change the material field to display.
    Hope it will do
    Regards,
    Raman

  • Making an editable PDF Form non-editable (a shortcut)

    How to make a PDF form non-editable or locked.
    For those who aren't script-savvy, I believe this may be a little shortcut to editing a PDF form and then saving and sending it as a non-editable or locked PDF.
    This is what I have written out for my client, whom I provided an editable PDF Form, so they could edit the PDF and then send it out to their own respective clients as a NON-editable PDF.
    Instructions as follows:
    How to save your PDF Form into a separate non-editable PDF to send to your client: (Using Adobe Acrobat Professional)
    Step 1. Fill out the original PDF Form
    Step 2. Once finished, go to “File” menu and click “Save a Copy” - title the file appropriately and save it to the desktop.
    Step 3. Close the editable PDF document and do not save it (Saving it will save over the original file). Now open up the PDF you’ve just saved to
                        the desktop (you’ll now take the steps to make this file only non-editable).
    Step 4. In the top menu, go to “Advanced” then select in that drop down menu “Security” then “Show Security Properties” - a ‘Document Properties’ window will now appear.
    Step 5. From this new window, select the “Security” Menu.  Set your ‘Security Method’ to ‘Password Security’.
    Step 6. A new window will appear named ‘Password Security Settings’. In this menu, tick the box that says “Restrict Editing & Printing of the document”
                you’ll need to a) set a password for it,  and  b) In the ‘Printing Allowed’ drop down box, select ‘high resolution’   and if you want to, tick the
                box that says ‘allow the copying of text, images and other content’
    Step 7. Click OK and Save the document. Now it’s not editable unless you have the password.
    Note: If you happen to want to edit the PDF at a later date, you can open the file and in the ‘Security settings’ menu on the left hand side
    (the menu is represented as a little gold lock) click ‘Permission Details’ then ‘Change Settings’ to revert everything back to an editable document
    - repeat the above steps to make it a locked document again.   

    Thanks for your suggestions. You should also consider flattening a form if you want a non-editable copy; because the permissions password is not always respected by third-party PDF applications (for some people the form will remain editable, depending on what software they're using).
    Flattening a form can be done in several ways in Acrobat: you can run a script - this.flattenPages() - or print the PDF back to PDF (aka refrying), or use the Sanitize tool in Acrobat X. It also strips out hidden content associated with the form (button actions, field calculation scripts, etc.) so provides additional data protection. Sanitize is the heavy-duty option of the three; it will remove all hidden content, leaving only what you see on the page.
    One correction to your workflow - the Save a Copy menu item is not intended for creating a duplicate of a normal form, it's only available if the  form has been rights-extended and it serves to remove the extension certificate from the PDF (allowing full editing in Acrobat again). As your client is working in Acrobat they don't need a rights-extended version in the first place, and working with a normal form will make things simpler for them. In Acrobat X Pro you could create them a custom Action which automatically flattens the file and saves a duplicate, so they don't accidentally overwrite the original.

Maybe you are looking for

  • PO item with Multiple Goods receipt line items

    Hi Experts, When we create PO for specific vendor with one PO line item then at the time of Good receipt there are multiple GR line items. How to control those multiple GR line items as one GR item. Appreciated your help Regards Krishna

  • The trouble of payment

    I have bought the credit through Apple store about two weeks ago. I also received a receipt from the I tune , somehow I don't know why the money never come into my Skype credit , it always showed $0.01

  • SWO1 - No destination could be determined for logical system

    Hi there, I am trying to call a remote transaction via SWO1, but I am getting the following error: No destination could be determined for logical system TSTCLNT120 Message no. OL860 Diagnosis You attempted to instantiate an object with the specified

  • Java with excel

    hi all, Is it possible to submit the values from an excel sheet to java Thanks in advance

  • Synchronizing Address Book against a home server

    I have a Bubba Two home server setup with Debian Etch, and a Mac Mini. I want to synchronize Address Book's contacts against this home server. What is the protocol or method of doing this? I want to synchronize the Address Book on two Macs through th