Problem with DefaultStyledDocument.styleChanged(Style)

I have a layout with 'text frames' that contain DefaultStyledDocument's.
I want to do a repaint of a textframe when the underlying paragraph style changes.
The way I do this is that I listen for changes and when a change in a Paragraph Style (StyleContenxt) occur, I do a DefaultStyledDocument.styleChanged( paragraphstyle.getStyle() );
After that I do a repaint() of the component.
All this goes well, and the component is repainted - but not with the new style. It still displays the old style, until I change it or move my mouse over it.
should .styleChanged() and repaint() be sufficient? Can anyone see what is going wrong here?

I suppose repaint() is called before all styles are updated. Try to call the repaint() in
SwingUtilities.invokeLater(
  new Runnable() {
);Or try to call refresh() of the document.
    public void refresh(int offset, int len) {
        DefaultDocumentEvent changes = new DefaultDocumentEvent(offset, len, DocumentEvent.EventType.CHANGE);
        Element root = getDefaultRootElement();
        Element[] removed = new Element[0];
        Element[] added = new Element[0];
        changes.addEdit(new ElementEdit(root, 0, removed, added));
        changes.end();
        fireChangedUpdate(changes);
    }regards,
Stas

Similar Messages

  • Having problem with applying layer style "stroke" to group

    - Windows 8.1 / 64bit
    - i3-4150 / 4GB / Geforce GTX 750 TI
    - Photoshop CC 2014
    Hi!
    I don't know why, but there is some problem that applying layer style "stroke" to group.
    When i make a group with some layer and apply to group a layer style-stroke with inside option,
    the strokes looks like grid are generated inside.
    Why i said that stroke cross to ㅎrid, because it looks like grid if i make that group bigger.
    (that black square is 'Rectangle 1' layer. Just resizing bigger than before)
    Does anyone have same problem with me?
    Please, I need your help..

    pillfish wrote:
    I am having the same problem. it happens every time in cc and cc 2014. I am back using cs6. Which seems to run better on the whole.
    That's interesting. And this is happening with CC and CC 2014?  Do you have all the updates for the Photoshop CC versions?
    I've just tried to duplicate it without success, (windows 7, GTX570) so I wonder if there is a condition that triggers it?  Unfortunately, with this being such an old thread, the only person still around is R Kelly.
    OK, I just thought to try it on my Cintiq Companion 2, which has Windows 8.1 and Intel 5100, and the bug occurred. I actually got as far as firing up my Win 8.1 laptop before remembering that I had to sign out of CC to put it on my Cintiq, so I only have CS6 on it.
    Anyway....  looks like the bug is still there.  Are you using Win 8.1?

  • Problem with text-indent style , select tag on IE

    Hi Developers,
    i tried text-indent style class for <select> <option> tag .. The following given code is working on Mozilla fire box browser, but it is not working on IE..
    I am trying to build a tree structure in the list box with multiple levels without ' ' and <OPTGROUP> does not support multiple levels.
    Here is the example with multiple levels.
    <html>
    <head>
    <title>Main </title>
    <style>
    .style {color:green;font-weight:bold}
    .style1 {text-indent:45px;color:red;}
    .style2 {text-indent:90px;color:blue;}
    .style3 {text-indent:135px;color:green;}
    </style>
    </head>
    <body>
    <form name="form1">
    <select name="retail" >
    <option selected disabled value="">Tree Structure</option>
    <option value="Father" class="style">Father</option>
    <option class="style1" value="/retail/chandler/">Son 1</option>
    <option class="style2" value="/retail/chandler/">Grand Son 1</option>
    <option class="style2" value="/retail/chandler/">Grand Son 2</option>
    <option class="style3" value="/retail/chandler/">Great Grand Son 1</option>
    <option class="style3" value="/retail/chandler/">Great Grand Son 2</option>
    <option class="style2" value="/retail/chandler/">Grand Son 3</option>
    <option class="style1" value="/retail/chandler/">Son 2</option>
    </select>
    </form>
    </body>
    </html>
    Please help me out by providing a solution to this issue.

    You have bigger problems than you realize.   On this page - the one after the Splash intro page,
    http://www.transgenic-rabbit-models.com/Home.html
    As seen in Firefox with increased text.  See screenshot.
    Notice how your text boxes are colliding into other text boxes?  This happens when web designers paint themselves into a corner with a rigid layout.  Web pages must be flexible for all screen and text sizes.
    You are using APDivs as a primary layout method which is a bad choice.  And here is why.
    http://apptools.com/examples/pagelayout101.php
    Suggested Tutorials -
    From  Tables to CSS Web Design Part 1 -
    http://www.adobe.com/devnet/dreamweaver/articles/table_to_css_pt1.html
    From   Tables to CSS Web Design Part 2 -
    http://www.adobe.com/devnet/dreamweaver/articles/table_to_css_pt2.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Problem with structure cell STYLE

    Hi
    I'm working a wad report with table interface i've already changed the style's structures with the STRUCTURE_CELL method, that's ok. Also i need to control the padding-left but when i tried this the style isn't be able to change it.
    It  took the style that is coming from the style class sapbexlevelh2 is its hierarchy in the structure, i checked the padding-left and i set it to 0, but the page generated putted &nbsp trying to make the distance... i would like to eliminate that space....any ideas?
    Thanks in advance

    Maria,
    If you notice the values for the cell - you would also find that there would be javascript for the arrow mark on the cell - that could be your problem which causes the &nbsp..
    Also it could be an issue with the WAD report trying to render the value in the same cell -
    http://www.xs4all.nl/~dimaroan/htl/faq1.html
    try increasing the column width...
    Arun
    Message was edited by:
            Arun Varadarajan

  • Problem with media print styles in debug versus nondebug mode

    Hi,
    I am trying to debug why the same page (and code) will print one way on one server and another way on another server. These servers are a dev and test server with the same version of cf 9 installed.
    I am working on a page that has two divs floated left next to each other.
    [div 1] [div 2]
    We had problems printing this setup in IE 8, so I created a CSS file for media type print that removes the float from div2.
    So in my page I have:
    <link rel="stylesheet" type="text/css" href="../common/main.css" media="screen"/>
    <link rel="stylesheet" type="text/css" href="../common/mainPrint.css" media="print"/>
    In main.css the class is:
    .documentArea {
          margin: 2.5em 1em 0 1em;
          float:left;
    In mainPrint.css the class is:
    .documentArea {
          margin: 2.5em 1em 0 1em;
    On the Dev server, I am able to view the page correctly in IE and it prints correctly with div 2 below div 1:
    [div 1]
    [div 2]
    When I move the SAME code to the our Test server and view it in the same IE browser, the display of the page is correct but the printed page only displays div 1 and not div 2 at all.
    After some investigations, I discovered that the the print CSS worked when debugging was on and not when it was off. We turned on debugging on the Test server and the CSS worked correctly for printing. I also changed the name of the style to my name (leslie) and it still didn't work. I thought perhaps a default style in CF might be overriding it.
    I am wondering if there are default CSS files in ColdFusion.
    If you have ANY suggestions as to what is happening I would greatly appreciate it!
    Regards,
    Leslie

    Just to clarify ....
    If the ERROR_CODE parameter is made an 'OUT' parameter instead of an 'IN OUT' parameter the correct return value is given for the OracleCommand invocation but the WRONG value is still returned for the EF Model invocation i.e. just changing the parameter from 'IN OUT' to just 'OUT' does not fix the problem.

  • Problem with simulator orientation style?

    hi..........every one:)
    which is the best way to fix orientation style for simulator?
    if possible please gave full description about Change the Orientation styles.
    Thanks Inadvance:)
    Srikanth

    i already try in 2 ways
    1. chane orientation style under by selecting project_target
    i choose only landscape.
    then it show only landscape by default.
    2. go to appdelegate.m  file
    change interface oreintation stle as UIInterfaceOrientationLandscape mode
    it will also change it.
    But ,Both are  working in temporarly.
    i want to fix it as Landscape mode only.

  • Problems with items in style drawer

    Not sure what I've done. I create the newsletter for our church. I started w/ a pre-made template and tweaked it to fit our needs. It has worked well for a couple years. Now, when I open up the Style Drawer, many of the styles are missing. There are big gaps in the list of Paragraph Styles, Character Styles etc. What have I done? Is there a way to restore all of the styles? Even when I open a new template - many style options are missing. Thanks in advance...Karen

    Do you have saved copies of the newsletter that have the lost styles??? If so you can import the styles from the old newsletter to a new document and save it as a template.
    Here is how the manual says how to do it:
    +To import styles from a Pages document:+
    +1 Choose Format > Import Styles.+
    +2 Select the document that contains the styles you want to import, and then click Open.+
    +3 Select the styles you want to import in the dialog. Hold down the Command key as you click the style names to select multiple styles, or click Select All.+
    +4 To replace styles in your document that have the same name as the styles you are importing, select “Replace duplicates.” Note that replacing a style will affect any text that uses this style; replacing a style also changes the style of text in locked objects, but the text retains its original appearance.+
    +If an imported style has the same name as a style in the open document and you do not select “Replace duplicates,” a number is appended to the name of the imported style. For example, if you import a style called Body to a document that already contains a Body style, the imported style will be named Body 2.+
    +5 Click OK.+
    +Imported paragraph styles will be available by clicking the Paragraph Style pop-up menu in the Format Bar and in the Styles drawer of your document. Imported character and list styles will be available in the Styles drawer.+
    +To maintain a consistent look among several documents, keep a master document that contains all the styles you need. When you need to change a style, change it in the master document and import the master document’s styles into the other documents.+
    Hope it'll help you!

  • How to solve problem with JSF table's border (style) ??

    Hi, I would like to create table in JSF like this
                   <table  align="center"
                             width="250"
                             style="border-collapse: collapse; border: 1px black solid;" >
                   <tr>
                        <td align="center"
                             colspan="2"
                             style="border: 1px black solid;">
                             Header A
                        </td>               
                   </tr>
                   <tr>
                        <td> a1 </td>
                        <td> a2 </td>
                   </tr>
                   <tr>
                        <td> b1 </td>
                        <td> b2 </td>
                   </tr>
                   <tr>
                        <td align="center"
                             colspan="2"
                             style="border: 1px black solid;" >                          
                             <BUTTON value="12" > button1 </BUTTON>
                             <BUTTON value="12">  button2 </BUTTON>
                        </td>
                   </tr>
                   </table>I don't know how to create borders like this with JSF's components.
    I know how to create table and collspan, but I have a problem with
    border and style.
    below is example that I creat it, but borders are not OK
    IF ANYONE FIND SOLUTION I WILL BE TANKFUL
    JSF:
    <hx:panelBox id="box1"
               layout="pageDirection"
               bgcolor="silver"
               align="center"
               style="border: 1px red solid;"
               border="0">
              <hx:panelBox id="box2" layout="pageDirection" width="100%" bgcolor="#aec74e" height="100%" align="center" style="border: 1px black solid;">
                   <center>
                        <h:outputText styleClass="outputText" id="text9" value="Prazniki"></h:outputText>
                   </center>                         
              </hx:panelBox>
              <h:panelGrid styleClass="panelGrid" id="grid1" columns="3">
                   <h:outputText styleClass="outputText" id="text4" value="#{msgs.planDan}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text3" value="#{pc_Koledar.praznikBean.dan}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text5" value="#{msgs.planMesec}">
                   </h:outputText>
                   <h:selectOneMenu styleClass="selectOneMenu" id="menu1" value="#{pc_Koledar.praznikBean.selectedMesec}">          
                    <f:selectItems value="#{pc_Koledar.praznikBean.meseci}" />          
                   </h:selectOneMenu>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text6" value="#{msgs.planLeto}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text2" value="#{pc_Koledar.praznikBean.leto}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
                   <h:outputText styleClass="outputText" id="text7" value="#{msgs.nazivPraznika}">
                   </h:outputText>
                   <h:inputText styleClass="inputText" id="text1" value="#{pc_Koledar.praznikBean.nazivPraznika}">
                   </h:inputText>
                   <f:verbatim></f:verbatim>
              </h:panelGrid>
              <hx:panelBox id="box3"           
                         align="center"
                         layout="lineDirection"
                         width="100%"
                         style="border: 1px black solid;" bgcolor="#aec74e">
                        <center>
                          <hx:commandExButton type="submit" value="Dodaj" id="button1" action="#{pc_Koledar.doButton1Action}" lang="CP1250">
                          </hx:commandExButton>
                           <hx:commandExButton type="submit" id="button3" action="#{pc_Koledar.doButton3Action}" value="Prika�">
                          </hx:commandExButton>
                        </center>
              </hx:panelBox>
    </hx:panelBox>

    Couldn't you use styleClass or id for CSS?

  • Problems with current week

    I am having problems with a YTD style measure and I don't know how to deal with it.
    I need to sum from one date - the same day each year - 1st april - to the current week. The current week is defined as the last data build date. For previous years, the cumulative is from the 1st april to the parallel week to the current week.
    There is an indicator in the database table that shows what week is the current week.
    How should I store an attribute in a hierarchy that indicates it is the current week ? As a property ?
    How would I sum from the 01st april to a current week using an attribute stored in a property in the Date dimension ?
    My Date dimension is daily and based on calendar weeks and calendar months.

    Hi ,
    Does the week is part of the hierarchy ? if so, you want to have range between two days, the 01/04 and the last day for that relevant week . Something like ..
    {[Date].[Calendar].[Day].&[20130401]:ClosingPeriod([Date].[Calendar].[Day], MyRelevantWeek)}
    You can achieve the relevant week by filtering the weeks without the right property :  Filter([Date].[Week].[Week] , [Date].[Week].CurrentMember.properties("RelevantWeek") = 1) .
    If you want to have a dynamic 1st to April for the relevant year, you'll need to build this member with the current year : strtomember("[Date].[Calendar].[Day].&["+str([Date].[Year].Currentmember.properties("key"))+"0401]")
    Hope it helps :)
    Regards, David .

  • Problems with a style sheet in InDesign CS3

    Hello everyone. I was wondering if anyone had any clue as to what the holy heck is happening to me.
    I am attempting to standardize our documents and use style sheets--hey, what a concept, right? So I'm going through a recently completed document and grabbing text and using that to create paragraph style sheets and character based style sheets.
    With one paragraph style sheet, the text is set to Janson Text Lt Stnd 55 Roman. However, when you apply the style sheet to a paragraph, the first word sets to a missing font. The rest of the paragraph is OK. It's only the first word. The paragraph style sheet does not have a "+" next to it. Highlighting the individual word and reapplying the paragraph style sheet does not change this.
    I went to the character style palette, thinking that there was an override. Nope, the character style was set to "None." I clicked on "Override" to apply the paragraph style, and again, the first word is stubbornly refusing to change.
    What gives? I am stumped!
    Best,
    Chryss

    Styles based on Basic paragraph are a nightmare because every document starts with a basic paragraph style, and there's no guarantee that it will be the same from document to document. When you import styles based on Basic Paragraph from some other document, different attributes will be overridden depending on what is the same, and what is different.
    The best way to deal with this is to either import the basic paragraph stle along with everything else, or put all the docs in one book file and pick one to use as the master, then synchronize the styles.
    It sounds like your first word problem could be an applied character style, though, or less likely, a nested style.
    Peter

  • Problem with CSS styles and Previewing in Firefox

    Hello,
    I recently rebooted my Mac OS X system (leopard) and reinstalled Adobe CS3. Before this I had virtually no problems with Dreamweaver and everything was running smoothly. However, now whenever I preview my pages in Safari, the CSS code is completely mangled.
    Also, my site won't preview in Firefox unless I close any existing tabs and exit Firefox completely. I have no idea why these problems are occurring, but I have pasted the code below so any advice would be extemely helpful.
    ---------------------------------html----------------------------------------
    <!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>armed and harmless</title>
    <link href="untitled.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
        <div id="nav">
        </div>
    </div>
    </body>
    </html>
    -----------------------------------css-----------------------------------
    @charset "UTF-8";
        background-color: #000000;
        background-image: url(images/header.jpg);
        background-repeat: no-repeat;
        margin: 0px;
    #wrapper {
        height: 800px;
        width: 1000px;
        margin-top: 0px;
        margin-right: auto;
        margin-left: auto;
        background-color: transparent;
        background-image: none;
    #wrapper #nav {
        background-color: transparent;
        background-image: none;
        height: 30px;
        width: 1000px;
        margin-top: 260px;
        clear: both;
        border-top-width: 1px;
        border-bottom-width: 1px;
        border-top-style: solid;
        border-bottom-style: solid;
        border-top-color: #FFFFFF;
        border-bottom-color: #FFFFFF;

    hey there,
    thanks so much for the insight on the firefox issue. hopefully they fix that soon.
    as for the css, i do have a screenshot of what's happening. the background image seems to repeat after the navigation bar instead of keeping the transparent background. it's extremely odd and i've never seen it before. it can be seen in the attached photo.
    thanks again for your help,
    -e

  • Performance problems with new Java Tiger style recommendations

    Performance problems with jdk 1.5 on Linux plattform
    (not tested on Windows, might be the same)
    using the new style recommendations.
    I need fast Vector loops for high speed mathematical calculations, some
    hints about the fastest way to program that loop would be also great!
    After refactoring using the new features from java 1.5 (as recommended from
    SUN) I lost performance significantly:
    using a vector:
    public Vector<unit> units;
    The new code (recommended from SUN for Java Tiger for redesign):
    for (unit u: units) u.accumulate();
    runs more than 30% slower than the old code:
    for (int i = 0; i < units.size(); i++) units.elementAt(i).accumulate();
    I expected the opposite.
    Is there any information available that helps?
    The following additional information I got from Mr. Shankar Unni:
    I got some fairly anomalous results comparing ArrayList and Vector: for the
    1.5-style loops, ArrayList was faster then Vector, but for a loop with get()
    calls, Vector was faster. Vector was even faster than that using
    elementAt(), which was a surprise:
    For a million summing iterations over a 100-element array:
    vector elementAt loop took 3446 ms.
    vector get loop took 3796 ms.
    vector iterator loop took 5469 ms.
    arraylist get loop took 4136 ms.
    arraylist iterator loop took 4668 ms.

    If your topic doesn't change, please stay in your original post.

  • Strange problem with Zen Style 300

    I got a Zen Style 300 for my birthday and it is given me some problems. I tried looking at this forum and on google, but so far haven't found anything like it. What happens is that during the sync process, some folders on my portable harddisk (which is where the music is located) get renamed into names with strange symbols and become unreadable. The strange thing is that it doesn't happen with all files and just as strange is that it does happen with files not related to the sync that are located in a completely different folder. You can imagine I got quite scared the first time, afraid of having lost my music collection, but on restart everything was fine again. Until I plugged in the ZEN again that is.
    My second problem is probably related to it. Part of the files transfered to the player don't show up when I try to listen to them with the player. When I check they have been copied to the player correctly, yet somehow they don't show up.
    I have Windows XP and tried syncing with the standard Creative software, MediaMonkey and iTunes but they all face the same problem. Although with the second problem it might happen that files copied one way don't show up, while the same files transfered with a different program do. All 3 cause the problem with my harddisk. I tried formatting the player and updating it. So anyone has any idea what might cause this?

    I have a similar problem. It recognized and paired with a Sony Ericsson MW600 Hi-Fi Bluetooth Stereo Headset once. I lost connection, could no longer connect, and tried to re-pair it. Now it recognizes the the headset's name (MW600), but when you try to pair with it stays on a "Please wait..." message. It will stay that way forever until I press the back (left) arrow. Then the message says "Remote Device not responding" and pairing fails. This MW600 headset pairs with other devices (cell phone, PC) just fine, though, so it's not malfunctioning.
    I suspect this might be a Bluetooth version compatibility issue? I say that because when I connect to a Jawbone Era (pretty new device, probably latest Bluetooth spec), everything goes fine.
    Also, if I clear all devices, then try to pair to just the Sony Ericsson MW600, I can get the M300 in a state where it hangs and will not respond to anything. I then have to press the reset button using a paperclip to start over.

  • Problem with footer in table style not applying paragraph style... or just me?

    I'm having a niggling problem making a table style with cell/paragraph styles for the header, body, and footer respectively. I want to make it as simple as possible for other users but one thing keeps tripping me up. I'll try and describe with screenshots. I'm using InDesign CS5 on Windows 7.
    I have a table style set up with cell styles for the header, body, and footer, and paragraph styles for each as well. Say I'm converting a list of generic text to this table:
    i convert it to my table style. The body style is a numbered list:
    I convert the header to an, err, Header. The cell applies the header paragraph style as I should expect:
    I convert the footer likewise, but it maintains the Body text paragraph style as an override!
    So naturally I clear the override and it works fine. But of course, I'd rather it acted like the header row. I can't work out where the override on the footer comes from and why it operates differently in this respect to the header row. There is nothing different about how the styles are constructed. Have I made a mistake somewhere, or is this correct behaviour I'm misinterpreting, or something...?
    edit: Here is the file, if that will help:
    https://www.dropbox.com/s/4kzgui1itaskuvz/strip%20list%20test.indd

    Hi,
    I was able to reproduce the issue you are facing.
    I will be logging a bug for this and it would be investigated.
    Thanks a lot for reporting the problem!!
    Javed

  • Having a problem with character styles in indesign

    I'm having another problem with my style sheets in indesign, I've now got an awful lot of styles in paragraph and character styles. I've created different styles for paragraph justified text and when I go to my style in paragraph styles to use tight text copy, character styles always overides it so it means I have to do  whole lot of extra formatting just to put it right. Does anyone have an idea how I can stop character styles overiding paragraph styles? Thanks very much.

    Perhaps your character styles apply more than you actually want? I.e., rather than just "+Italic" it also applies custom tracking. You should use character styles only to override the stuff you really want to change.
    You can check by calling up the definition for those character styles; the huge "Style Settings" text box lists all the attributes it changes.

Maybe you are looking for

  • HP 7515 won't Scan to Computer

    i'm using Windows 7 Home Premium 64 bit and an HP 7515 All in One.  When I originally setup the printer, whenever I rebooted the PC a window would pop-up asking to enable Scan to Computer. That no longer happens. When I attempt to Scan to Computer fr

  • WLS 10.3 Does not respond to GET requests (HTTP/1.0)

    Hi All, I have 2 WLS servers running on separate physical hosts behind a cisco CSS load balancer. The keep-alive method the Cisco CSS uses is HTTP GET messages. This keep-alive method does not appear to work, because my WLS servers are not responding

  • Default values not showing up in CAT2

    Hi Guys, Using tcode CAC1 I have configure to show the default values of Cost Center and Activity type from IT0315. But for some reason I cannot see the default values in CAT2 for any of the PERNR. Please let me know what else I am missing. Thanks  a

  • Items In safari reading list get duplicated

    For some strange reason any items that I add to my reading list in safari get duplicated, about 5 times. Same thing happens to my bookmarks that are outside the "bookmarks bar" and "bookmarks menu" folders. I have an ipad, an iphone and one computer

  • Open the files in jsp, help!

    i'm trying to call a bean in jsp in order to open a file exists in the same machine as tomcat. but it seems not work properly for no modification occurred to the file after operation on it. the sample code is shown below: <% com.genesys.FileOpr fo=ne