AbstractTableModel.isCellEditable() vs. copy/paste operations

Say I have a JTable with 2 columns (strings), the 1st with a default cell renderer, and the 2nd one with a renderer extended from JPasswordField. So far so good. But I don't want the 1st column to be editable. So I modify the model to return false for isCellEditable(r,c) for that column.
What I am finding is that making a cell non-editable also renders it immune to copy/paste operations. I want to be able to select/copy the non-editable cell and value, and paste it into the 2nd column (via Ctrl-c/Ctrl-v). The copy operation only appears to work if isCellEditable() is true. ..
I fooled around with a TableCellEditor to try to make an "editable" cell that would allow selection/copy without actually allowing a value change, but couldn't get it to work.
What am I missing?

Something like this should work
Label l = new Label (...);
l.addKeyListener (new KeyAdapter() {
public void keyTyped (KeyEvent ke) {
if (ke.getModifiers()&KeyEvent.CTRL_DOWN_MASK!=0) {
if (ke.getKeyChar()=='c') ...

Similar Messages

  • Copy / paste operations crash all SGD windows

    Hi
    From time to time, users have problems during copy/paste operations between SGD windows.
    When users use this function between (for ex.) gterm and x-emacs v2.22 windows, all SGD windows crash.
    The support asked them to migrate to the new SGD version (at this time 4.41) but this problem still appears.
    We configured the coreadm with all options enable but it seems we don't have any generated core files.
    Does anyone already got this problem ?
    Thank's for your answers !
    Edited by: furtherup on Mar 26, 2009 12:47 AM

    I'm having the same problem. I don't use ZoneAlarm or Avira.
    I just use the built-in Windows Defender in Windows 8.
    My problem started in v22 and I still have it in v23.
    I've tried all the suggestions posted at various websites, but I still can't copy and paste in Firefox.
    Any ideas?

  • Error "Compile error: Invalid character" after copy paste operations in VBE 6.5 PowerPoint 2011

    This is a weird problem with the VBE 6.5 in Office 2011, running natively on a Mac.
    Sometimes, yet often, when I select a word by double clicking on it or a line by highlighting that line in the editor and then copy/paste it somewhere else in the code, the compiler throws the error "Compile error: Invalid character"
    The thing is, what I see has been pasted is exactly the same as the source text. However, if I then paste the same clipboard item to a text editor, I can see that there is an 'invisible' character at the end of the string which is counted in the text editor
    where the cursor is shifted past it but does not shown on the screen!!!
    Back in the VBE, if I select a line that is dubious and drag it, the semi transparent dragged text has a '>' character on a new line.
    In some copy/paste cases, the compiler doesn't see an error but the code doesn't work as expected and I have spent hours debugging stuff that has invisible characters in it (the hardest debugging I've ever had to do!).
    I'm not sure if this example will paste correctly into the forum but this looks like 19 characters but is in fact 20 as there is the offending copy/paste invisible character between 'Test' and '.'
    <code>Test.Value = False</code>
    This seems to be a major oversight in the code of the VBE 6.5 so are Microsoft aware of this and when is it due to be fixed?
    Jamie.

    I had this exact issue.  This is a terrible bug.  The code looks perfect, but there are hidden characters that throw compiler errors.  Thanks for the quick fix, Microsoft.

  • RegExp for massive copy/paste operation

    I run a books site with ~3,500 HTML pages on it. At the
    bottom of each page, in the main div, where the text goes, is a
    navigation link, for previous, next, and contents. As it's annoying
    for users to scroll to the bottom of the screen to navigate, I need
    to copy the nav link on each page and paste it up at the top of the
    div as well. There has to be a way to do this, possibly with a Perl
    script, but I have no idea how.
    At the risk of becoming a code mooch, can someone tell me how
    to do this? I figure some sort of RegExp operation might do it. I
    never use the Search and Replace in DW, relying instead on my
    trusty text editor, but I'm guessing that would be involved
    somehow.
    Hope all are well.

    MellowCricket wrote:
    > I run a books site with ~3,500 HTML pages on it. At the
    bottom of each page, in
    > the main div, where the text goes, is a navigation link,
    for previous, next,
    > and contents. As it's annoying for users to scroll to
    the bottom of the screen
    > to navigate, I need to copy the nav link on each page
    and paste it up at the
    > top of the div as well. There has to be a way to do
    this, possibly with a Perl
    > script, but I have no idea how.
    >
    > At the risk of becoming a code mooch, can someone tell
    me how to do this? I
    > figure some sort of RegExp operation might do it. I
    never use the Search and
    > Replace in DW, relying instead on my trusty text editor,
    but I'm guessing that
    > would be involved somehow.
    >
    > Hope all are well.
    >
    We would need an example of the navigation link and which
    parts of it
    change. The task is trivial with F & R.
    Mick.

  • Cut,copy,paste operations in applet in LINUX

    Hai friends,
    I implemented cut copy operations in applet for windows. But it is not operable in Linux.Can any one resolve this problem.
    regards,
    srinivas

    [url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html#howto]How to Remove Key Bindings

  • CR duplication when Copy/Pasting text from a JTextArea

    I have a typical scenario of having text in a JTextArea. When I select some of that text and try to paste it either to an external text editor or even in the same JTextArea, I am getting extra line spaces in the screen.
    For example, if I have the following text:
    <a id=1>
       <b/>
    </a>When I copy paste it, I get:
    <a id=1>
       <b/>
    </a>When I looked to see what characters were being used for the CR, I see "\r\n". This is the standard line.seperator for Windows OS which is fine. When I save this text to a file using the Java I/O libraries, it is fine (no extra lines). But when copy/pasting it prints extra lines.
    Has anyone had similar problems?

    Has anyone had similar problems? No. How are you doing the copy/paste? Did you write your own routines or are you using the default Actions. By default, when a Document is loaded it will convert the "\r\n" end of line string to "\n" and store the single character in the Document. When you use the getText(..) method the enod of line string will be expanded to "\r\n" on a Windows system, but this should not happen in a copy/paste operation. How do you add data to your text area?
    This section from the Swing tutorial on "Text Component Features" has a working example of using copy/paste:
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html

  • Update pages in form by import then copy/paste

    I have inherited a dynamic interactive PDF. Essentially what they did was take multiple pdfs and put them in one, visually shown below.
    form1.pdf, 1 page-----
    |
    form2.pdf, 2 pages----
    |---------> formall.pdf
    form3.pdf, 4 pages----
    |
    form4.pdf, 3 pages----
    |
    etc...----------------
    Well now they have made massive changes to form2.pdf and form4.pdf and I am supposed to update formall.pdf.
    Is there any way to pull NewForm2.pdf into the existing formall.pdf, and then copy/paste the fields from the current form2 in formall.pdf onto the new one, then delete the old form2 pages?
    The changes in NewForm2 are extensive and it would take quite a while to just redo form2 inside formall.
    I do not think they thought about updates when they created formall.pdf. I would like to separate the forms and use something like Forms Server, or even add each form into a library where I could add the new version and create a new formall, but I do not have time.
    The only tools I have are LiveCycle Designer 7 and Adobe Reader 7.05. I do NOT have Acrobat.
    I have seen several posts about inserting pdfs from Designer into Acrobat to update, but not inserting pdfs into Designer to update.
    I tried importing NewForm2.pdf into Designer with formall.pdf already open, but it always creates a completely new form.
    Thanks

    I exported a PDF from Pages v5.2.2. This uses Apple's Quartz PDFContext, not Quark.
    In Windows 7, I opened this PDF with Adobe Acrobat Reader v11.0.09. I then copied/pasted a paragraph of this PDF content into LibreOffice Writer (v4.3.2.2). Since there was Baskerville in Windows 7, this comment pasted correctly including font-size. I did not have to make any adjustments to LO to accept this text.
    On Ubuntu Linux 14.04, with the latest updates, I opened the same PDF in Evince, the default PDF viewer. Adobe does not offer an Acrobat Reader download for Linux. Again, I copied and pasted a paragraph of content from the PDF viewer into LibreOffice Writer. As there was no Baskerville installed, Writer defaulted to the Liberation font, at the correct point size.
    In either of these platform scenarios, there were no anomalies with sentence/paragraph newlines .vs. carriage return issues from the PDF document during copy/paste operations. These were default control-v pastes that did not use the Paste Special menu item in LibreOffice.

  • Copy-paste hotkeys in F2B3 Design View

    Problem:
    At this moment only [Ctrl+Insert] and [Shift+Insert] hotkeys
    (shortcuts) can be used for copying and pasting components in
    Design View of Flex 2 Beta 3. But in Code View [Ctrl+C] and
    [Ctrl+V] hotkeys can be used for copy-paste operations too.
    Suggestion:
    It would be more convenient to use [Ctrl+C] and [Ctrl+V]
    hotkeys for copy-pasting Design View of Flex 2 Beta 3 too because:
    They're used in Code View already;
    They more familiar for many users.
    Solution:
    Add [Ctrl+V] and [Ctrl+C] to default hotkeys for copy-pasting
    in Design View of Flex 2 Beta 3.

    "<body leftmargin="float">"
    Can you say what that's doing? "float" is not a legal value for the leftmargin style, which requires an integer value.  But its use is deprecated in favor of CSS anyhow.
    Your pasted code is lacking a doctype or anything that would normally be above that stylesheet link.  Is that just an oversight or is it really not there?

  • Some general ?'s re: urxvt, copy/paste, etc.

    I started using urxvt, and I just checked the manpage and what I believe is the section on keybindings was quite confusing for me. I am used to gnome-terminal's ctrl+alt+c/v for copy/paste, and just want to double check a few things.
    1. In urxvt, highlight with either left/right mouse and which kb button/shortcut will copy? And what is the paste command in urxvt (above gnome-terminal combo doesn't work I just realized).
    2. Doing it this way, I can only paste with middle mouse button, ctrl+v in FF for example doesn't paste it, and I am confused about why?
    3. Can someone give me a fairly basic command/rundown for configuring/viewing keybindings in urxvt? I have checked the manpage like I said and it was a bit baffling.
    Thanks folks I really want to learn it, appreciate any help to get me in the right direction with some basics

    colbert wrote:Is it just separate clipboards and that's how it is?
    Yes. As a matter of fact, clipboard managers such as Glipper allow for collection of copied items based on whether the items come from the Primary selection (highlight & middleclick) or the Clipboard (CTL+C & CTL+V, etc.).
    See my post here:
    http://bbs.archlinux.org/viewtopic.php? … 26#p279226
    (especially the link at the bottom) for more detailed info about the copy and paste implementation in X11.
    By the way, I recently began using rxvt-unicode, and two things that I find require some adjustment are the use of the Primary selection for copy / paste (without the option for using the Clipboard) and no drag and drop support.
    Because of urxvt's use of the Primary clipboard, I had to enable that feature in Glipper (which I normally have disabled), and it certainly leads to a lot of junk filling up Glipper's copy / paste list. Every time you highlight something whether you intended to copy and paste it or not, the item ends up in the list making it more difficult to cull out the items you really intended to re-use for copy & paste operations.
    I guess everything has its pros and cons, and I'm still on the fence about whether the pros of urxvt outweigh the cons. I'm leaning towards keeping it for now.
    Edit: grammar
    Last edited by MrWeatherbee (2008-01-21 21:42:32)

  • Problem with copy/paste into WYSIWYG field?

    In using Robo HTML X5 my helpfile design is a simple one, but
    one issue is stumping me.
    -From the TOC tab I will create a new topic, and then edit
    the WYSIWYG field on the right, insert graphics, etc. But if I cut
    and paste from Word 2003 into the WYSIWYG topic field, all
    formatting like bold letting is stripped out, along with graphics.
    The graphics have to be cut and pasted individually and I manually
    have to reformat the text.
    Does anyone know why a copy/paste into the WYSIWYG field is
    being stripped of formatting somehow? Is there simple project
    setting somewhere?

    Hi reiver12367 and welcome to our community
    Trust me on this. Mixing Word and RoboHelp HTML are like
    mixing oil and water. You really don't want to go down any road
    where formatting is maintained during a copy/paste operation.
    You might see better results by right clicking the folder
    (inside RoboHelp HTML) where you want the topic to be, then
    selecting Import. From there, choose the Word document file type
    from the drop-down on the bottom of the dialog, navigate to and
    choose your Word document. You will have a couple of dialogs to
    deal with and the stuff should import in.
    Personally, I even avoid going that route if I can. I instead
    opt for saving the Word document as pure ASCII text. Then creating
    a new topic and copy/pasting the text into the topic. From there I
    format as needed.
    Hopefully this helps... Rick

  • How to observe Copy&Paste ?( not just AddToHierarchy)

    Hello!
    I need to observe Copy&Paste event.
    The approach with Doc Observer attached ( protocol IID_IHIERARCHY_DOCUMENT) gives me ability to catch
    theChange = kNewPageItemCmdBoss and AddToHierarchyCmdBoss.
    My problem is that this events occur also on another use cases then Copy&Paste ( for example - just create Frame).
    But i need to perform some custom action ONLY if Copy&Paste ( of Frames) occur.
    ( actually, i need Paste event )
    How can i do this ?
    Any help will be appreciated.
    Thanks.

    No, there isn't any way to hook these events.
    And even if you could, would it be for ALL copy/paste operations, only for some, for certainly data types?   I would recommend that you look at simply hooking the standard OS clipboard/scrap operations.

  • How to hook copy/paste events?

    I'm trying to have copy/paste (and maybe cut) trigger a method that I have written. I have looked into it and so far I have not found an easy way (such as with open/close/save events).
    I saw some stuff involving AVDocSelectionPasteProc and AVDocSelectionCopyProc but it looks like I would need to create a selection server and then register these with that. I'm not quite sure how to go about doing that. I don't want to replace what happens during copy/paste events, just have them trigger a message to be sent out. Is there an easier way of doing this, or how should I go about doing it?
    Thanks

    No, there isn't any way to hook these events.
    And even if you could, would it be for ALL copy/paste operations, only for some, for certainly data types?   I would recommend that you look at simply hooking the standard OS clipboard/scrap operations.

  • Field that dosen't permit Copy&paste.

    Hi everybody,
         I need to create an input field in a screen that doesn’t and won’t permit coping from it. In other words an input field that is visible but not selectable. Another way to solve my need would be to restrict the paste of this field.
    I’ve thought of creating an image from it and posting it but it’s too complicated and would consume a lot of resources. If anybody has a better idea or knows how to do this please answer.
    Thanks a lot.

    Hi Jorge,
    To have a field that does not allow copying from it is difficult to handle. In fact almost impossible, if there is NO other activity on the screen.
    You would have to write your own event handler in ABAP objects and build a trigger mechanism that listens to the activation or déactivation of a field.
    However, in order to give you some help, there is a way to cleanup the CLIPBOARD (so any entries in it are removed, thus preventing a CTRL+V (paste) operation.
    Simply place this in the first PAI module of your screen:
    DATA: myrc TYPE i.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      CHANGING
        rc = myrc
      EXCEPTIONS
        CNTL_ERROR   = 1
        ERROR_NO_GUI = 2
        others       = 3.
    Of course you need to handle possible errors (clean up SY-SUBRC). Also keep in mind, that this does NOT prevent COPY & PASTE operation, as long as the screen has NOT passed the PAI event in your program.
    Hope this gives you a clue,
    Regards,
    Rob.

  • When trying to copy and paste on my MAC using firefox, I keep coming across a message "your browser security settings don't permit the editor to automatically execute pasting operations". This only happens with firfox, not Safari. any help??

    When trying to copy and paste on my MAC using firefox, I keep coming across a message "your browser security settings don't permit the editor to automatically execute pasting operations". This only happens with firefox, not Safari. any help??

    See:<br />
    http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
    https://addons.mozilla.org/firefox/addon/852 - AllowClipboard Helper

  • Operations Manager 2012 Dashboard Copy/Paste?

    Is there any possible way to copy and paste a Dashboard view in the Operations Manager 2012 console?
    I have a user that has been using APG to display performance data from SMARTS and wants a similar experience with OpsMgr. The APG console is setup with dashboards for each server that include widgets for CPU utilization, memory utilization and
    disk utilization. I can set the same thing up in an Operations Manager dashboard, but to do it for 100+ would be very time consuming. Why is the copy/paste function not available for dashboard views? Is there some other easier method to create
    dashboards, based on a template?

    Hi,
    Dashboard don't have that function. To get more information about Dashboard, you can refer to this article.
    https://blogs.technet.com/b/momteam/archive/2011/09/27/introducing-operations-manager-2012-dashboards.aspx
    Niki Han
    TechNet Community Support

Maybe you are looking for