Editable Text + Highlightable Text

I want to have three functions with dealing with a block of Text in my program.
(1) I want to highlight and make certain a certain row is highlighted at which the user cannot edit the text. The highlighting process is used by the GUI not the user.
(2) I want to a allow the text to be allowed at my will.
(3) When editing is allowed, I only want certain lines to be editable.
Also I won't be using the wrap around feature.
So far I have looked at JList and JTextArea
JTextArea
Pro's:
I can allow the user to edit the code freely.
Con's:
I don't know how to prevent editing certain rows or highlight them.
JList
Pro's:
I can highlight certain rows.
I'm certain a can change individual lines.
Con's:
I can't imagine it being so freely editable.
I'm leaning more towards using JList but I am not sure how to go about adding and removing certain rows. Otherwise, I can make sure which lines are not changed. It would be alright if the user had to click a row to edit it but I also want to add and remove. The API doesn't seem to support that kind of operation. I'm just wondering if anyone out there has any ideas on how to implement this.
Thanks (@)(@)

In the future, Swing related questions should be posted in the Swing forum.
Not sure, but the [Protected Text Component|http://www.camick.com/java/blog.html?name=protected-text-component].

Similar Messages

  • How can i highlight text in the Adobe Difital Editions?

    How can i highlight text in the Adobe Difital Editions?

    You have to remember that Digital Editions was never designed to have 'text
    editor' capabilities.  BTW: Bluefire and Overdrive also have such
    limitations.  Put in another frame of reference, DE presents you with the
    ebook, as you would be presented with a physical printed book.
    ==============

  • Can't highlight text in blue to edit

    My Pages has just started doing this recently. When I go to highlight text it only highlights in gray and not the usual blue. And of course it will not let me edit. Has any one seen this or have any idea what is causing this?
    I have an iMac running 10.10 and I am using Pages 4.3 I also have Pages 5.5.2 open because I need to view other files.

    Blue is normal selected text.
    Orange is placeholder text.
    Grey can be a link. Of course it doesn't have to be a link, just declared as one. Clicking on it should have the Link edit dialog pop up, click on edit and remove.
    Peter

  • Highlighting  text (as in Word)

    Hi - Is is possible to highlight text, that is color over text, in a similar way to how it can be done in Word. I use this feature in Word a lot for editing & redrafting purposes!
    Many thanks!

    pete scott1 wrote:
    Hi - Is is possible to highlight text, that is color over text, in a similar way to how it can be done in Word. I use this feature in Word a lot for editing & redrafting purposes!
    Many thanks!
    *A slightly more efficient system of highlighting text: (and possibly slightly more efficient than MSword as well as you can highlight text with a keyboard shortcut after a simple initial setup.)*
    *+step 1+*
    select text. apply background colour.
    *+step 2+*
    open styles drawer through menu or shiftcmdt
    *+step 3+*
    _select again_ the text you applied the b/g colour to previously. in the styles drawer, under character styles, click the little upside-down triangle and click +create new character style from selection+. name your style.
    ( *+step 4+* - *Keyboard shortcut and use* )
    click on the upside-down triangle for options on your new style and add a hotkey. f6 works fine as it's not usually already assigned to another function. _*now, highlight away by selecting text and either clicking on the highlight style in the styles drawer, or simply pressing f6.*_
    ( *+step 5+* )
    to maintain the highlight style you created in the styles drawer as a default style for all documents, use this tip by Dennis from another post
    +Start with a blank document, set it up the way you want (fonts, views, rulers, styles, etc.), then click on File > Save As Template. Finally, click on Pages > Preferences > and set that template as your startup document. That way, every time Pages opens, you'll have your preferred styles right there handy.+
    If you don't want to mess with templates for some odd reason, you can always import the style from a previously highlighted document to which the style you created is attached. Use Format -> +Import Styles+

  • Highlighting text in emails

    Is there anyway to highlight text of emails I receive? I would like to be able to highlight the important sections in some the very wordy emails I get, so I go back to read them, I don't have to reread the whole thing!
    Thanks for your help!
    Message was edited by: pb_raza

    How could I suggest this to Apple?
    http://www.apple.com/feedback/macosx.html

  • How do you highlight text in document in Pages

    How do you highlight text in document in Pages

    but Pages is NOT a 3rd party app.  it's an application that's programmed by apple.  it's supposed to act something like Word in MS office, but that is not at all true. 
    choices for editing text, highlighting, et al., like what you find in MS Office Word, should be immediately available whenever you are inside of a Pages document, but that is not the case. 
    don't you wish that when you buy an apple app for apple/macs that is supposed to be like a windows something or another that it really is? 

  • How do I highlight text in the new Pages?  It's not clear.

    I have the new version of Pages.  And it appears that highlighting of text is an issue.  This is a basic function.
    I found there is one quick key version, but doesn't clearly explain how to change highlighting colours.  How to get into it.
    I have to explain this to my 80 year old mom, who we told to get a Mac because it was easier!
    So if anyone has it laid out step 1, 2, 3, that would be helpful, because it's not clear to me either.
    Thanks!
    Apple - please to a quick fix for this one, it should be the same as changing the size or the font or like bold or italic.  Simple, clear, fast and doable..... for anyone!

    TO Peter,
    Thanks for the list. I had found it in LibreOffice, tucked away in the Background tab of the Character pane opened by the Character... menu item in the Format menu, and named "Background Color. A few steps further down than in Pages. Apache OpenOffice has it in the same place. But both also have a hilight icon in the toolbar.
    I didn't fin highlighting or Color fill in Text Edit (v1.8). Might need a further search.
    But this well-equipped party of (one) oscurantist did find a shorter path to highlighting text in Pages '09, cleverly hidden in plain view! See the image below.
    TO hscortez,
    I'm aware that changing the text colour is not highlighting.
    But YeOldMacFan pointed out how to change text colour AND how to change background colour of text, using Character fill, found in the Advanced Options (Pages 5) or the More (Pages '09) tab of the Text Inspector.
    Character Fill fills the space around the character with the chosen colour. As shown above, it's essentially the same effect as dragging a hiliter pen along a line of printed text.
    Unfortunately, whats shown above is the Character fill well on the format bar of Pages '09—right out in the open like the highlighter pen button in LibreOffice, and presumeably in MS Word. I don't have Pages 5 (avoiding it until a few more of the missing features arrive), but I do note that Pages for iOS offers highlight as one of the options in the contextual menu that appears when a block of text is selcted.
    The process appears to be:
    tap twice to select some text.
    drag the handles at each end of the selection to adjust what's selected.
    tap Highlight in the menu that has appeared on the screen.
    One thing missing appears to be colour choice. The default is a 'hiliter yellow'. I didn't see a way to select a different colour.
    "Hopefully, this will make it on their upgrade list. "
    Hope is good, but taking action is useful.
    Pages menu > Provide Pages Feedback > Make your request that this be added to Pages 5. Requests made through Provide ...Feedback go directly to Apple. Comments and questions here are read by users like yourself, and we don't have the ability to change the way the apps work. Not directly,anyway.
    Regards,
    Barry

  • Printing document with Notes/Comments and underlined/highlighted text

    Dear all,
    I have been reading a document and highlighted & underlined parts of it.
    In addition I also inserted notes.
    Now when trying to print the document with the "summarize comments function" (I translate this from the
    german version so there it might be called somewhat differently in english) in the print menue, I receive a the
    original document plus attached several pages including my notes (now numbered) PLUS entries for every line I highlighted, underlined etc.
    Evidently I only want the text of my comments, not empty entries for each line I have highlighted.
    To be clear, I would like to keep the text highlighted / underlined - but I don't need the
    entries for that in the appended section. A document of 18 pages otherwise suddently gets 48 pages...(with only
    a few added notes).
    I have to say I am somewhat puzzled how difficult it is to sort this out. Thought that must be
    something rather trival (or am I blind and make a silly mistake)?
    To make it more clear here screenshot from what I refer to
    Many thanks for any help.
    r

    Dear Lori,
    many thanks for your swift response. Did I understand you correctly - there is no way to keep all the comments (underlined/highlighted/stick notes) in the text and only inlcude the content of the sticky notes at the end of the document? If I filter, as suggested by you, then the underlined/highlighted parts will not show up in the appended pages (that's good) - but they are also not longer visible in the main text (that's bad...).
    I would have thought what I am trying is rather ordinary - Highlighting/underlining text and adding comments. And when I print the document, i would like to get the edited text plus the content of the comments (sticky notes). (And not an empty entry for all highlighted/underlined words). I am somewhat puzzled.
    Many thanks again.
    r

  • Adobe Reader 9 highlights text when scrolling in terminal server

    Running a terminal server with WIndow 2003.  Have Adobe 9 Reader installed.  When a pdf is opened, it will look correct.  However, when one uses the scroll bar on the right to see more of the document, text can be highlighted and change colors constantly when scrolling.
    Test it outside of terminal server and it works fine.  This issue did not happen with other versions of Reader.  I have attached two samples one clean and one highlighted. 
    Any help is appreciated

    Very cool. Thanks for the info!
    Date: Fri, 16 Oct 2009 10:42:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Adobe Reader 9 highlights text when scrolling in terminal server
    Okay. Here is what I found. These settings are changed\saved under the User settings in the registry. Here is the key the changes are made to:
    HKCU\Software\Adobe\Adobe Reader\9.0\Originals
    When "NONE" is selected from Adobe Reader - Edit - Preferences - Page Display - Rendering, three DWORD values are added to the above mentioned registry key. These are:
    Value Name - Value Data
    *bAntialiasText - 0
    benableDDR - 0
    iAntialiasThreshold - 12*
    I have added these lines to a login script that adds the necessary DWORD values to default the "Rendering" to NONE.
    *reg add "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /V bAntialiasText /T REG_DWORD /F /D 0
    reg add "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /V benableDDR /T REG_DWORD /F /D 0
    reg add "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /V iAntialiasThreshold /T REG_DWORD /F /D 12*
    Cheers!
    >

  • Changing highlight text color / using Highlighters

    I've subclassed JTextArea, and among other things, am trying to add the functionality for drawing the active selection even when the TextArea doesn't have focus. I've overridden processFocusEvent like so:
    public void processFocusEvent(FocusEvent e){
            Highlighter h = this.getHighlighter();
             if (e.getID() == e.FOCUS_GAINED){
                //remove the inactive highlight
                h.removeAllHighlights();
            //this will put the selection highlight back in for us, among other things,
            //if we just gained focus.
            super.processFocusEvent(e);
            //now add the inactive-selection highlight if we just lost focus
            if (e.getID() == e.FOCUS_LOST){
                try {
                    h.addHighlight(
                            this.getSelectionStart(),
                            this.getSelectionEnd(),
                            new DefaultHighlighter.DefaultHighlightPainter(
                                new Color(212,212,212)
                } catch (Exception ex){
                    ex.printStackTrace();
        }and it works quite nicely. Notice that I draw the inactive selection gray.
    There's a slight problem with this: JTextArea doesn't treat the text in the highlighted section any differently, as opposed to how it would when the component is focused (i.e. rendering it in the highlighted text color). I'm guessing this is because it knows that it's not focused, and therefore assumes that there's no highlighting to be drawn. So as a result, all text in the text area is rendered in the same color --- the foreground color --- when the textArea doesn't have focus, regardless of what is being highlighted. For this reason, setSelectedTextColor() has no effect.
    But I want to be able to change the highlighted text color, since, in theory, the user's system could be configured to show text in the exact same gray that I'm highlighting with. I want to just be able to set it to be white or black.
    I am rather averse to using a TextPane, since what I'm writing is designed to edit plain text, and a TextArea has many wheels that I don't want to reinvent, like setTabSize(), for example.
    Clearly, there is code already in place somewhere to draw text a different color for highlighted portions of a TextArea. Is there some way I could perhaps trick only the drawing code into thinking that it has focus? What is the cleanest way to accomplish what I want, i.e. the way that involves rewriting the least amount of functionality?
    Any suggestions/leads would be greatly appreciated.

    Here's a better way to keep the selection visible. All those hard-coded colors are a big no-no, but this is just to demonstrate the technique.
    import java.awt.Color;
    import javax.swing.text.DefaultCaret;
    import javax.swing.text.Highlighter;
    import javax.swing.text.DefaultHighlighter;
    * usage:
    * textComponent.setCaret(new GhostCaret());
    public class GhostCaret extends DefaultCaret
      private static final Highlighter.HighlightPainter unfocusedPainter =
          new DefaultHighlighter.DefaultHighlightPainter(new Color(230, 230, 210));
      private boolean isFocused;
      protected Highlighter.HighlightPainter getSelectionPainter()
        return isFocused ? SimpleHighlighter.defaultPainter : unfocusedPainter;
      public void setSelectionVisible(boolean hasFocus)
        if (hasFocus != isFocused)
          isFocused = hasFocus;
          super.setSelectionVisible(false);
          super.setSelectionVisible(true);
          getComponent().setSelectedTextColor(isFocused ? Color.WHITE : Color.BLACK);
    }

  • How do I highlight text in an Outlook e-mail in Firefox?

    I use Firefox for Outlook e-mails because IE keeps shutting down when I add an attachment. However, I see no option for highlighting text in an e-mail, only bold, etc.

    I couldn't find an add-on, so I created a bookmarklet. This is a "button" you drag to your Bookmarks Toolbar which instead of loading a web page runs a script on the current page. To give it a try, you can install the bookmarklet from the following page:
    http://dev.jeffersonscher.com/bookmarklets.html#olhilite
    Then when you have highlighted text in your message, click the button to give it a yellow, cyan, or green background. If you prefer another color, you can edit the script (I can describe how). Unfortunately, these are not bidirectional, meaning, there's no way to use them to remove or change the highlighting. But maybe it's better than nothing.

  • Can't Highlight Text

    I haven't figured out a way to highlight text in any of the Pages versions. By highlight I mean color the background behind specific words in a sentence, much like people do with a yellow highlighting pen in a book. Microsoft Word has this feature and calls it highlighting. Under the fonts inspector, the document color is always applied to the entire line, I haven't figured out it there is a way to restrict it to particular characters on the line.
    This is a pretty common feature, I would be surprised if its not supported.
    Thanks for your insights,
    Ken

    Welcome to Apple Discussions
    Do a search in the Pages Help ('09, I didn't check all versions) for "highlight" & choose the second topic, Setting Character and Paragraph Fill Colors.
    Message was edited by: Peggy

  • [SOLVED] Highlighted text in the shell, appearance rxvt-unicode

    Hi,
    Short question, when I highlight text in the shell or when text get highlighted in ncmpcpp or outer app running in the shell it gets basically impossible to read. Because background to text get the same color and strength then the text.
    what setting should I look for to change what it look like when I mark and highlight text in the shell?
    Thank you!
    All the best,
    Christer
    Last edited by agkbill (2012-10-13 20:41:41)

    Additional info.
    I am using i3 as window manager and  terminal emulator "rxvt-unicode-256color"
    .xinitrc
    # set the cursor
    xsetroot -cursor_name left_ptr
    # set German keyboard layout
    # setxkbmap -layout de
    # start xmonad
    #Power management turn off monitor etc
    #xset dpms 0 7200 10800 &
    xset -dpms; xset s off
    # xloadimage laddar bakgrundsbild fick det inte att fungera tillsamans med xcompmgr som man
    # använder för att få genomskinliga terminal fönster mm. Ersätter med bildvisaren "feh"
    #xloadimage -onroot -fullscreen /home/christer/devices-extern/windows7/archlinux/stone_wall_ce.png
    xrdb -merge ~/.Xresources # Denna rad behövs ifall man vill använda TERMINAL/emulator "urxvt"
    feh --bg-scale /home/christer/devices-extern/windows7/archlinux/stone_wall_ce.png
    setxkbmap -layout "us, se" -option "grp:alt_shift_toggle" #alt"grp:caps_toggle"
    xcompmgr -c &
    #xmonad
    #awesome
    exec /usr/bin/i3 -V -d all >~/i3log/i3log-$(date +'%F-%k-%M-%S') 2>&1
    .Xresources
    # transparency - true or false (default)
    #URxvt*transparent: true
    # tint with any color; i.e., blue, red, tomato4, olivedrab2, etc.
    # some nice listings are at:
    # http://www.nisrv.com/drupal/?q=node/11
    # http://www.htmlgoodies.com/tutorials/colors/article.php/3478921
    URxvt*tintColor: white
    URxvt*inheritPixmap: true
    # shading - 0 to 99 darkens, 101 to 200 lightens.
    # Don't use with tintColor; just use a darker or lighter color instead.
    #URxvt*shading: 40
    # scrollback buffer lines - 65535 is max on most machines (64 is default)
    URxvt*saveLines: 12000
    # font color (default is black)
    URxvt*foreground: DarkSlateGray1
    # background color (prior to tinting) (default is white)
    URxvt.depth: 32
    URxvt.background: [10]#black
    # Xft (X FreeType) with Bitstream, DejaVu, Liberation, or Terminus fonts:
    # Fedora/debian packages: libXft/libxft2
    # An anti-aliased font setup with Xft looks fantastic; it can be a bit choppy
    # on older systems. You can always turn off anti-aliasing (antialias=false) if
    # your terminal is sluggish. Use only ONE of the Xft pairs below:
    # Xft: Bitstream fonts
    # Fedora/debian packages: bitstream-vera-sans-mono-fonts/ttf-bitstream-vera
    #URxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=12:antialias=true:hinting=true
    #URxvt*boldFont: xft:Bitstream Vera Sans Mono:bold:pixelsize=12:antialias=true:hinting=true
    # Xft: DejaVu fonts
    # Fedora/debian packages: dejavu-sans-mono-fonts/ttf-dejavu
    URxvt*font: xft:DejaVu Sans Mono:pixelsize=12:antialias=true:hinting=true
    URxvt*boldFont: xft:DejaVu Sans Mono:bold:pixelsize=12:antialias=true:hinting=true
    # Xft: Liberation fonts
    # Fedora/debian packages: liberation-mono-fonts/ttf-liberation
    #URxvt*font: xft:Liberation Mono:pixelsize=13:antialias=true:hinting=true
    #URxvt*boldFont: xft:Liberation Mono:bold:pixelsize=13:antialias=true:hinting=true
    # Xft: Terminus fonts
    # Fedora/debian packages: terminus-fonts/xfonts-terminus
    #URxvt*font: xft:terminus:pixelsize=15
    #URxvt*boldFont: xft:terminus:bold:pixelsize=15
    # Traditional fonts - a more traditional font setup in lieu of xft
    #URxvt*font:-*-courier-medium-r-normal-*-14-*-*-*-*-*-iso8859-1
    #URxvt*boldFont:-*-courier-bold-r-normal-*-14-*-*-*-*-*-iso8859-1
    # Replace blue folder colors with a lighter shade for clarity. To
    # set colored folders and files within urxvt, xterm, and aterm, add
    # the following line to your ~/.bashrc ($HOME/.bashrc) file under
    # the heading "# User specific aliases and functions":
    # alias ls="ls -h --color=auto"
    URxvt*color4: RoyalBlue
    URxvt*color12: RoyalBlue
    # scrollbar - true (default) or false
    URxvt*scrollBar: false
    # scrollbar position - left=false (default) or right=true
    URxvt*scrollBar_right: false
    # scrollbar style - rxvt (default), plain, next, or xterm
    URxvt*scrollstyle: plain
    #Fade the text by the given percentage when focus is lost.
    URxvt*enable-fading on
    URxvt*fade 50
    URxvt*fadecolor black
    Biggest problem is when I running console based applications like ncmpcpp or ranger.
    Last edited by agkbill (2012-10-13 08:34:28)

  • Highlight text for Print

    I am trying to find a way to be able to highlight text in a document and and then print it with the text highlighted (as you would when reading an article and marking thru important points with a pen highlighter) Also how would I highlight multiple but different text lines so that they all show? I can't seem to find a key that will allow it. (ie. control or option key)
    Thanks for your advice,
    Glen

    ApleWorks doesn't provide for any method to directly "highlight text for printing," or for display on a monitor, for that matter. The 'highlighting' you see after dragging across a line or block of text is an indication that the text is Selected, and may now be manipulated, but tat highlighting will not appear on a printed page.
    You can "place a colour block behind" the text to create an effect similar to running a hi-liter across the text on a printed page, it's fairly easy, and the result will print.
    Show the Tools palette (Window > Show tools, or click the red toolbox at the lower left of the document window).
    Use the Rectangle tool to draw a rectangle that just covers the text you want to highlight.
    Use the Fill formatting button then the color palette to select a highlight colour. Repeat using the formatting button then the color palette to set the line colour to the same value as the fill colour.
    Copy the rectangle so that you can re-use it.
    Go Arrange > Move to back to place the rectangle behind the (now highlighted) text.
    Still in Draw mode (you should have the Arrow mouse pointer—if not, click on the Selection tool {arrow} in the tools palette), Paste another copy of the coloured rectangle, drag it to the next line of text you want to highlight, and adjust the length to cover the text to be highlighted. Move to back as above. Repeat as necessary.
    NOTE that these rectangles are not part of the text, but floating objects. If you edit text above the highlighted portion, change fonts or size, or change style (eg. to bold), the text to be highlighted will move, but the rectangles will not. Best to leave this highlighting until you've finished otherwise revising text.
    NOTE2: When resizing small rectangles like this, it's easy to change their height when trying to change only their length.
    TIP: When you have one the right size for the text size and font you are using, select it, then go Options > Object size... and note the height of the object, reported in the second box in the right column. For subsequent highlight rectangles, after adjusting the length to fit the text to be highlighted, open the Object size dialogue, enter the correct size into the Height box, then press tab to confirm the entry.
    Regards,
    Barry

  • Stop text highlight tool from auto-selecting punctuation?

    In Acrobat X, I need to highlight a word but NOT the comma following it. How do I stop the Highlight Text tool from automatically including punctuation in the highlight? This is driving me nuts!

    Not quite sure if I know what you mean... I'm not typing any punctuation in my comments because it's not part of what I want to mark for editing.
    I guess if I want to tell the editor to change the following:
    colourful, long-lived
    to
    colorful, long-lived
    then I'm forced to highlight the comma along with "colourful" and type out the replacement text as "colorful," (with the comma)
    or else I'm instructing them to produce this:
    colorful long-lived
    which would be wrong.

Maybe you are looking for

  • How can I store passwords that have been deleted

    I had usernames and passwords stored for several e-mail accounts on the same site. These were accidentally removed from the saved passwords list, and now I cannot get Firefox (23.0) to remember them again. I do have password saving enabled (behind a

  • My home button has stopped working.  I have to shut the phone down every time I want to toggle back and forth through apps.

    My iPhone 4 is having issues w/the home button.  It doesn't work at all and I have to shut the phone own completely each time I want to toggle back and Roth ou of different apps, to us the phone, take pics., etc.  Is there a fix for this issue or wil

  • Ms office multiple triggers

    Anybody have step by step on how to get Ms office 2010 to work so you can launch the individual apps, word,excel,pwrpoint????? I understand you need to use multiple trigger points but not sure how you would launch them and have icons like the non vir

  • Unable to open WAD (Web Application Designer) SAP BW 3.x

    Hi experts In my computer I don´t open WAD (SAP BW 3.x) i make click start-> programs -> Business Explorer-> Business Explorer(SAP BW 3.x)-> Web Application Designer(SAP BW 3.x) appears following error: This application requires Internet Explorer 5 o

  • Is there a way to revert back to the old 'New Tab' button?

    I would like to be able to place a 'New Tab' button right next to (or on) the current active tab like previous versions allowed. I believe even pre-RC versions of Firefox 4.0 did this, now I can't do this after updating to the latest version. (admitt