How can I add border at some words in a JTextPane?

Hi,
With the class StyleConstants I can modify the paragraph attributes, character constants, font constants, ... But, howcan I add border at some words in a JTextPane?

The simplest way is to add your own custom attibute to character element of your document (by setCharacterAttributes()) method. And override LabelView. In the paint method of the LabelView just check whether parent element's attributes contains the attribute.
    public void paint(Graphics g, Shape allocation) {
        super.paint(g, allocation);
        if  (containsAttribute) {
           ((Graphics2D)g).draw(allocation);
    }regards,
Stas

Similar Messages

  • Hi Sir! I have some questions regarding word report generation please.1.How can i add border to a word page?.2.How can i add grid lines to a table generated in word report?.3.How can i add border to a table of word report?.Thanks Imran Pakistan

    Hi !
    Sir I have some questions regarding word report generation using(C language in labwindows) Please.
    1.How can i add border to a word page?.
    2.How can i add border and grid lines to a table generated in word report(Not the " cvi table control" inserted from gui,i am asking about the table generated in word report)?
    3.How can i fill a cell of word report table withe the data type other than "character"?.
    And sir one question about use of timer in cvi labwindows please.
    Sir i'm trying to set minimum delay interval of timer control to 1millisecond(0.001s),as i set ,timer don't cares of the interval that is set by me it responds only to the default minimum time interval which is i think 10milliseconds(i'am using windows xp service pack3 version 2002).
    Regards
    Imran
    Pakistan
    Solved!
    Go to Solution.

    Hello sir!
    Sir i'm using daq6251.But Sir before implimenting it to my final application now i'm just trying to achieve 1millisecond time interval for timer in a vary simple programe i mean at this time no hardware (daq device) is  involved i,m just trying to achieve minimum time interval of 1millisecond.
    Sir i read form "help" of labwindows how this time interval can be set,i'm trying for,as described in help notes but i could'nt.I'm attaching a screen shot sir for you it may helpful for you to explain me.
    And sir also waiting for your kind reply regarding word report generation.
    Thanks.
    Imran.
    Attachments:
    screen_shot_rigistry.docx ‏65 KB

  • How can I add barcode to my word template for PDF ?

    I must use a Barcode in my personal card template in MS word.
    Barcode properties must be;
    bcCode 39, checksum (enable - csmModulo10)
    If I preview my template in RTF template, it works. Hovewer when I run PDF preview, I couldn't take a barcode output.
    How can I add a barcode to my word template for PDF ???

    I will put the barcode font file to OA_JRE_TOP/jre/lib/fonts and I will create xdo.cfg file at this path OA_JRE_TOP/jre/lib. I will add below code to xdo.cfg
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <config version="1.0.0" xmlns="http://xmlns.oracle.com/oxp/config/">
    <!-- XML Publisher configuration file. -->
    <!-- Please uncomment an element or property to enable options -->
    <!-- Copy the file to <JRE_TOP>/lib directory on all nodes -->
    <!-- (web node and concurrent nodes) named as xdo.cfg -->
    <!-- Properties -->
    <properties>
    <!-- Temporary directory -->
    <!-- Specify temporary directory. $APPLTMP directory -->
    <!-- is strongly recommended for this parameter. -->
    <!-- On concurrent node, $APPLTMP will be used by -->
    <!-- default. -->
    <property name="system-temp-dir">/disk1/oracle/app/ERPcomn/temp</property> -- I used my own path
    </properties >
    <fonts>
    <!-- Font setting (for FO to PDF etc...) -->
    <!-- <family> is case insensitive. -->
    <!-- <style> must be "italic" or "normal" -->
    <!-- <weight> must be "bold" or "normal" -->
    <!-- Follow the structure of <trutype path="...." /> -->
    <!-- to map a font to a TrueType font. -->
    <!-- Example of mapping "MS Gothic" to -->
    <!-- kochi-gothic-subst.ttf -->
    <!-- #remove this line to uncomment
    <font family="MS Gothic" style="normal" weight="normal" >
    <truetype path="/usr/lib/X11R6/lib/X11/fonts/truetype/kochi-gothic-subst.ttf" />
    </font>
    #remove this line to uncomment -->
    <!-- Example of mapping "MS Mincho" to -->
    <!-- kochi-mincho-subst.ttf -->
    <!-- #remove this line to uncomment
    <font family="MS Mincho" style="normal" weight="normal" >
    <truetype path="/usr/lib/X11R6/lib/X11/fonts/truetype/kochi-mincho-subst.ttf" />
    </font>
    #remove this line to uncomment -->
    <!-- Default font is ALBANWTJ.ttf. You can change the -->
    <!-- font by mapping "Default" font family to another -->
    <!-- font.
    <font family="Default" style="normal" weight="normal" >
    <truetype path="OA_JRE_TOP/jre/lib/fonts/mybarcodefont.ttf" />
    </font>
    </fonts>
    </config>
    Now I can use my Barcode fonts by using my concurent XML program...
    Thanks Ravi...

  • How can I add a black border at the bottom of a photo?

    How can I add a black border at the bottom of a photo?

    Just curious: Why whould you want to add navigation Rules at run time. I believe the navigation rules should be set to begin with - "by s/w Architect Design".
    Else you can always use Redirect / Forward.

  • How can I add a red line below all those words, which are not technically correct? And how can I do Pages to do it automatically?

    So, how can I add the red line below all those words, which are not technically correct.
    I have tried everything, but nothing works. Red line should come there automatically, but I can't find nothing from settings to do this. Can you guys help me?

    There isn't any finnish spellcheck in Pages
    Inspector palette = Asetukset
    I am trying to find out where to get a finnish dictionary that can work in Pages. I am not sure but try this
    http://www.jkwchui.com/2010/03/spellchecking-latex-in-macosx/

  • How can I add a word to the dictionary?

    How can I add a word to the dictionary on my iPhone 6 plus?
    Thanks.

    There's not an option to add a word to the dictionary. However, after typing that word several times, it will start to recognize it and offer it as a suggested word.

  • How can I add a preferred word to my autocorrect dictionary on my iPhone 5c?

    How can I add a word (my son's name) to the autocorrect dictionary in my iPhone 5c?  It would be helpful in both messaging and mail.  Thank you!

    Actually you can, & quite easily. Follow the directions here:
    http://gigaom.com/2011/10/14/ios-5-how-to-add-words-to-the-auto-correct-dictiona ry/

  • How can I add/retrieve Word/Excell files to iCloud?

    I have an iCloud Account that I haven't used in the past. How can I add/delete/retrieve files such as Word & Excel files?

    To save arbitrary document types in iCloud on MacOS X 10.9.5 have a look at Winston Churchill's User Tip: 
    See this link:  Using iCloud to sync multiple document types.
    This will work between Macs, but not for mobile devices.

  • How can I add a word to Safari's dictionary?

    Now and then I encounter properly spelled English words which are not recognized by the Safari dictionary or spell checker.  I would like to add those words to the Safari dictionary, but I do not see that option.  How can I add a word to Safari's dictionary/spell checker?

    Type the word in any app (e.g., Messages) followed by a spacebar and let it be "corrected."  Then type a backspace and other options including your original "wrong" spelling will appear above the autocorrected word. Tap the one that matches your original typing. That will change it back to the way you entered it and also adds it to the dictionary.

  • HT1848 How can I add photos to the iPad while not deleting any currently on it? I have some photos from my brother's camera that I can't get again.  How could save them onto my iMac?

    I have uploaded photos from my brother's camera while on vacation to my iPad (1).  Now that I wish to add even more photos to the iPad,  iTunes say that it will replace all the photos once I sync again to add from an album on the iMac.
    WHOA.
    I'd like to upload the photos to the iMac! HOw can I do that?
    How can I add photos from albums on the iMac and not lose the ones I currently have stored onthe iPad.
    I cannot find this task addressed in any Help reference.
    I do not understand why I cannot make a simple file transfer back and forth.
    Many thanks!

    Another way. You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov; DSCN0164.jpg).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import. (You can not export using the camera connection kit.)
    Secrets of the iPad Camera Connection Kit
    http://howto.cnet.com/8301-11310_39-57401068-285/secrets-of-the-ipad-camera-conn ection-kit/
     Cheers, Tom

  • How come I can't add lyrics to some music?

    For some reason I can't add lyrics to some music files.  The lyrics tab is gray'ed out.  What gives?

    Select such a song in iTunes then select File > Show in Finder. In the Finder, select File > Get Info.
    Under "General", what is its "Kind"?
    At the bottom of the Get Info window, under "Sharing & Permissions" does it say "You can read and write"?

  • How can I add more than one same spry menu (eg. collapsible menu)  with in different styles (font size, color, background, etc) on current page?

    How can I add more than one same spry menu (eg. collapsible menu)  with in different styles (font size, color, background, etc) on current page?

    Hi Nancy,
    This screenshot was only for imagination. A part of the code (not all) is below.  In the code there are some background images but they are not seem in live mode.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="css/my_site.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css"/>
    <link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
    <style>
    #CollapsiblePanel1 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-color: #003366;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel1 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        line-height: 52px;
    #CollapsiblePanel1 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/international.jpg);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel2 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelContent {
        background-color: blue;
    #CollapsiblePanel3 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel3 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel3 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel4 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel4 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel4 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel5 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel5 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel5 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    </style>

  • How can I add footnotes to a text in a table?

    To make use of a wider margin next to longer texts I usually work with two column tables in WORD. No problem to add footnotes to a text there.
    How can I add footnotes to text in a table when using PAGES?
    Or -alternatively - how can I write an ordinary text that has still a wider margin into which you can add annotations, notes etc.?

    Footnotes doesn't work for tables in Pages. You can create columns in Pages. You can use Insert column break to  being able to keep some text in one column and some in the other. Foot notes will work here.

  • How can i add filename on a document in pages 5.1 ?

    I am allways using a template to make documents, that I save under different names. How can I add the (changed) filename in the footer of a saved document ?
    It is important to me to print the filename on document, to find and edit it on my mac later.
    In MS Word it is easy to automaticaly add filenames, path, author and other filedata to the document. I can't find how to do that automatically in Pages templates.
    I saw earlyer answers to this question on this community, but they don't work as I expect, or only on earlier versions of pages.....  I trust there is an easy way to do this.
    Can someone help me please ?

    That function, present in "Pages 09" (i.e. Pages 4.3) , was not included in Pages 5.0-5.1.  (Nor were nearly 100 other such features, from mail merge and bookmarks to non-contiguous text selection, 2-up page viewing and the ability to set alternating left/right margins, headers & footers.Version 5.1 is also notably buggy. One work around, or partial work around, is to click the file name at the top of the window document. You can then select the filename, copy it  and paste it whereever you like. As far as I can see, however, there is no way to include the path: all you get is the filename and extension.

  • How can I add a field to a Repeating Frame in the body of a 9i Report

    How can I add a field to a Repeating Frame in the body of an Oracle 9i Report whose source is in a higher group?
    I want to change an Oracle 9i report. The report has no header or trailer but only a body. The body has the parent frame fields & a repeating frame with four fields, A, B, C & D. They all seem to be in one group. I want to add another field E to the repeating frame whose source is from the 'header'.
    I added the field & created a boiler plate & then added the new field, E to the original group A, B, C & D. In the Property Inspector for the field, I pointed the source to the source column in the main query. However, when I run the report, I receive the error "Invalid body size". Some notes on Metalink indicate that this could be due to margins being out of the printable area.
    Moreover, after making the changes & after having unsuccessfully run the report, when I try to open the Page Layout for the report, I get no details.
    Thanks,

    Hi,
    i also got same query can u pls tell me elaborately, if u can can u pls send some code.
    Thanks & Regards
    Jagadeeshwar.B

Maybe you are looking for

  • Oracle Database Express Edition SQL Developer

    Hi all, I did download the Oracle Database Express Edition from Oracle's website and am trying to create a new connection with the following info Connection Name: myconnection Username: ora21 Password: ora21 Hostname: localhost Port: 1521 SID: orcl N

  • APP-OFA-48392: Depreciation has been processed for this asset

    Hi, we are working in oracle applications 11i. In Oracle assets module, on the attempt from the user to modify the description of an asset item (from asset workbench -open) , when clicking the DONE button, the following error shows up: APP-OFA-48392:

  • Hide elements depending on other elements value

    how can I hide elements (for example af:commandButton) when I change the value of another element (for example af:selectOneChoice)

  • F7 & F8 shortcut keys not working with Apple's new keyboard

    Using a Mac with Macs newish low profile keyboard. Nothing happens when I use these keys. The F5 & F6 keys work just fine. Is there something I'm doing wrong? Or is the new Apple keyboard not compatible with these shortcuts? What to do? plmk, thanks.

  • Connecting the UC560 to a Two Loop Start Trunk Line

                       I just installed a new UC560 and am ready to convert from our old Panasonic DBS 84 system. The Panasonic is fed by 4 trunk lines that go into two RJ14 trunk connectors. so that each is a Two loop start trunk line plugged into the P