Advanced styling with JTextPane

i am currently trying to develop a method to render html tags to a JTextPane window- i can deal with bold, itallic, underlinded etc. styles but im having probelms trying to render the preformatted tag <pre>. the JTextPane automatically word wraps anything entered which is not what i want, does anyone know of a way to either stop word wrapping or to markup the text to prevent it from wrapping.
I am aware that there is a libary that can render this for me (JTextPane.setPage(String url) has shown me that <pre> can be rendered correctly) but i have been instructed not to use this. Can anyone suggest anything that might help? im going crazy trying to think up a soloution!

What i mean is that i have to read in a html document and render (select tags) it without using HTMLEditorKit and HTMLDocument. Like i said i can render text so its bold, itallic, do tables, etc. but the <pre> tag is giving me problems.

Similar Messages

  • Problem with JTextPane and StateInvariantError

    Hi. I am having a problem with JTextPanes and changing only certain text to bold. I am writing a chat program and would like to allow users to make certain text in their entries bold. The best way I can think of to do this is to add <b> and </b> tags to the beginning and end of any text that is to be bold. When the other client receives the message, the program will take out all of the <b> and </b> tags and display any text between them as bold (or italic with <i> and </i>). I've searched the forums a lot and figured out several ways to make the text bold, and several ways to determine which text is bold before sending the text, but none that work together. Currently, I add the bold tags with this code: (note: messageDoc is a StyledDocument and messageText is a JTextPane)
    public String getMessageText() {
              String text = null;
              boolean bold = false, italic = false;
              for (int i = 0; i < messageDoc.getLength(); i++) {
                   messageText.setCaretPosition(i);
                   if (StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && !bold) {
                        bold = true;
                        if (text != null) {
                             text = text + "<b>";
                        else {
                             text = "<b>";
                   else if (StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && bold) {
                        // Do nothing
                   else if (!StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && bold) {
                        bold = false;
                        if (text != null) {
                             text = text + "</b>";
                        else {
                             text = "</b>";
                   try {
                        if (text != null) {
                             text = text + messageDoc.getText(i,1);
                        else {
                             text = messageDoc.getText(i, 1);
                   catch (BadLocationException e) {
                        System.out.println("An error occurred while getting the text from the message document");
                        e.printStackTrace();
              return text;
         } // end getMessageText()When the message is sent to the other client, the program searches through the received message and changes the text between the bold tags to bold. This seems as if it should work, but as soon as I click on the bold button, I get a StateInvariantError. The code for my button is:
    public void actionPerformed(ActionEvent evt) {
              if (evt.getSource() == bold) {
                   MutableAttributeSet bold = new SimpleAttributeSet();
                   StyleConstants.setBold(bold, true);
                   messageText.getStyledDocument().setCharacterAttributes(messageText.getSelectionStart(), messageText.getSelectionStart() - messageText.getSelectionEnd() - 1, bold, false);
         } //end actionPerformed()Can anyone help me to figure out why this error is being thrown? I have searched for a while to figure out this way of doing what I'm trying to do and I've found out that a StateInvariantError has been reported as a bug in several different circumstances but not in relation to this. Or, if there is a better way to add and check the style of the text that would be great as well. Any help is much appreciated, thanks in advance.

    Swing related questions should be posted in the Swing forum.
    Can't tell from you code what the problem is because I don't know the context of how each method is invoked. But it would seem like you are trying to query the data in the Document while the Document is being updated. Try wrapping the getMessageText() method is a SwingUtilities.invokeLater().
    There is no need to write custom code for a Bold Action you can just use:
    JButton bold = new JButton( new StyledEditorKit.BoldAction() );Also your code to build the text String is not very efficient. You should not be using string concatenation to append text to the string. You should be using a StringBuffer or StringBuilder.

  • Topology Theme / Advanced Styling - Errors

    Hello
    We're undertaking some evaluation / proof of concept activities with mapviewer connected to fusion middleware 11g / 11g2 database
    Our application would require a topological data model and we have successfully created a small topological testbed.
    The topological model can be successfully interrogated in mapbuilder and displays in mapviewer when simple line styles are applied.
    There are two problems:
    1) when displayed as a themeBasedFOI in mapviewer the topological theme is not clickable so cannot be interrogated (yes all the obvious settings have been tried)
    2) the topology theme cannot be combined with an advanced Style (to enable lines to have different styles according to a attribute columns in the topology table)
    The styling problem manifests itself as a dialogue box displaying "Error 0" when using mapbuilder and an error "SEVERE: Error rendering FOI image java.lang.ArrayIndexOutOfBoundsException: 0" on the mapviewer console.
    As these problems do not manifest themselves when using geometry themes and the topological data seems otherwise to work correctly I'm inclined to think this is a bug in the topology code but would be interested to know if anyone else has experienced / resolved this?
    Mal
    Edited by: user5883580 on 28-Oct-2010 08:53
    Edited by: user5883580 on 28-Oct-2010 08:53

    The processing of geometry themes and topology themes are different. The attribute 'rule#0' that you see on the query for geometry themes is something internal of MapViewer that is added on the query. This does not apply for topology themes. You can use advanced style with topology themes. The idea is similar to geometry themes, where you add some attribute to be used by the advanced style. Post the advanced style definition and the topology theme definition that you were trying to use.
    Joao

  • How many domains can Prime Collaboration Advanced manage with the BE6000?

    The BE6000 Administration guide states that "Most BE6K deployments have a single domain as part of a Standard Prime installation. Multiple domains are available with Prime Collaboration Advanced (available for purchase) that can be used for complex Business Edition 6000 deployments."
    How many domains can Prime Collaboration Advanced manage with the BE6000 solution? How do we order and deploy Prime Collaboration Advanced with the BE6000 solution?

    http://docwiki.cisco.com/wiki/System_Capacity_for_Cisco_Prime_Collaboration_10.0

  • How to get current row of Advanced table with no submit

    I have an advanced table with an 'Add another button'. When an empty row is created by clicking this button, LOV is used on the first column to populate other fields of the row. The rows of the table carry a button called "Add dependencies" whose functionality is to take the user to a different table to add rows to a different VO. This button is just a button and not a submitButton. I am passing the row's primary key as part of the URI as Vo attribute FdTaskId={@FdTaskId}
    The button works perfectly fine for database fetched rows (rows already present in the database), but, for the rows created using 'Add Another button', though LOV populates all fields including the primary key, the URI parameter passes null to the next page. That means, the VO attribute is not set. This works fine only when a 'submit' happens in the first page. For example, if I click Add another row again, then the previously inserted row passes the primary key fine as part of {@FdTaskId}.
    Could you please help me how I can resolve this issue?
    Thanks,
    Datta

    I am doing exactly that. My issues is that, VO attribute is passed correct for the table rows which are fetched from the database. For the table rows which got created through 'Add Another button', the VO attribute passed through URI as {@FdTaskId} is returning null. The VO attribute sets only when a form submit happens. For example, after adding a row through 'Add another row' button, click the same button again to add one more row and now go back to previously added row and now you can see that its VO attribute is set ({@FdTaskId} carries value )

  • ISSUE: TDS REVERSAL DURING ADVANCE CLEARING WITH INVOICE

    Dear All
      I am having problem related to TDS reversal.
    For e.g
    Advance payment to Vendor: rs 10000/
    Tds deducted is rs 200/
    Now Invoice posted for amount is: 100000/
    Tds deductes is rs 1000/
    We know that TDS on rs 10000 is deducted twice which is generally reversed during advance clearing with invoice through F-54. But when I am clearing Ad. with Invoice, no TDS is getting reversed.
    Please help me on this issue or is there any other way of doing this process.
    points will be awarded
    Thanks in advance
    sandeep panwar

    Hi
    run the program RWTF010 in SE38
    Regards
    Sanil Bhandari

  • Row Level PPR in Advanced Table with Add More Rows Button

    <br>
    I have programmatically fired PPR event on MessageChoice. But it is in Advanced Table with
    Add More Rows Button. When the value is changed in MessageChoice I Show/Hide Custom LOV
    through SPEL like this ${oa.BioEmployeePVO.EmpManagerRender} .
    But it is <b>hiding the all the ROWS</b> not just the row where the value has been changed.
    I even tried with this code and get NULL for rowReference.
    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    In Processrequest()
    String pageName = pageContext.getRootRegionCode();
         Hashtable params = new Hashtable (1);
         params.put ("param1", pageName);
         Hashtable paramsWithBinds = new Hashtable(1);
        paramsWithBinds.put ("param2",new OADataBoundValueFireActionURL (mcb, "{$AttendeeType}"));
        mcb.setFireActionForSubmit ("empPositionChange", params, paramsWithBinds,false, false);
    In ProcessFormRequest() {
    if ("empPositionChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))   
          String rowReference = pageContext.getParameter("param2");
        //    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
         Serializable[] parameters = { rowReference };
          am.invokeMethod("handlePositionChangeEvent", parameters);
    <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    HI Kumar,
    Answer to your last post is "yes".
    Now to your doubt regarding the code:
    Hi Anna
    I am trying to understand your code.
    FireAction firePartialAction = new FirePartialAction("fireHideEvent"+(i/noOfTlaColSpan));
    HideImgBean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
    1. What is this i/noOfTlaColSpan ?
    :)Forget abt this in your case it should be the event name which u r firing and capturing the it in the PFR.
    Like FireAction firePartialAction = new FirePartialAction("YOurEventName");
    and in PFR u can capture tht as:
    if("YOurEventName".equals(pageContext.getParameter(EVENT_PARAM)))
    //your logic to invoke AM method
    2. I believe this HideImgBean would be MessageChoice for me?
    :)Yep ur right
    3. This brcdOhInventoryViewUpdateVOImpl would be the Custom PVO(Extending Seeded Base VO)
    I create by adding the transient attributes?
    :)Yep ur right
    4. I cannot understand this code. Could you explain.
    :)Please look at my comments in some of the lines .I have explained wht i am doing
    if(updateIter==null)
    updateIter[0]= invViewVO.createRowSetIterator("updateIter");//This initViewVo should be ur custom VO object
    if(cnt>0)
    updateIter[0].setRangeStart(0);
    updateIter[0].setRangeSize(cnt);
    for(int i=0;i<cnt;i++)
    row = (brcdOhInventoryViewUpdateVORowImpl)updateIter[0].getRowAtRangeIndex(i);
    String selectFlag=(String)row.invokeMethod("getPartNumber");//This getPartNuber should be replaced by the Prim Key inoke methd of ur VO
    if(RowID.equals(selectFlag))
    //This is my logic to set the transient attributes based on the msgChoiceBean value ..u have to pass the value when u invoke this method
    if(reserveMethod.equals("BINARY"))
    System.out.println("In Binary");
    Boolean bVal= new Boolean("false");
    Serializable sr[]={bVal};
    Class []methodParamTypes = { bVal.getClass() };
    row.invokeMethod("setshowreservetxt",sr,methodParamTypes);
    Boolean bVal1= new Boolean("true");
    System.out.println("bVal1"+bVal1);
    Serializable sr1[]={bVal1};
    Class []methodParamTypes1 = { bVal1.getClass() };
    row.invokeMethod("setShowreservemsgchoice",sr1,methodParamTypes1);
    break;
    In my AM I am doing this. Am i doing right?:)Yep u r right
    BioPrescribersPVO is the custom VO(extending seeded base VO).
    public void handlePositionChangeEvent(String param)
    OAViewObject vo = (OAViewObject)findViewObject("BioPrescribersPVO");
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    String position = (String)row.getAttribute("AttendeeType");
    if (("PRESCRIBER".equals(position)) )
    // BioEmpManagerRender is the transient attribute in BioPrescribersPVO.
    row.setAttribute("BioEmpManagerRender", Boolean.TRUE);
    row.setAttribute("BioPresManagerRender", Boolean.FALSE);
    else
    row.setAttribute("BioEmpManagerRender", Boolean.FALSE);
    row.setAttribute("BioPresManagerRender", Boolean.TRUE);
    } // end handlePositionChangeEvent()
    // Initializing the custom VO
    /*No need to initialize the VO because this is not a PVO(Propeties View object)
    U r just using the existing VO and tht vo shloud have a primary key.Tht way u can match the rowref u r getting with the actual row from the View object*/
    public void init()
    OAViewObject appPropsVO = (OAViewObject)getBioPrescribersPVO();
    if (appPropsVO != null)
    if (appPropsVO.getFetchedRowCount() == 0)
    appPropsVO.setMaxFetchSize(0); appPropsVO.executeQuery();
    appPropsVO.insertRow(appPropsVO.createRow());
    OARow row = (OARow)appPropsVO.first();
    row.setAttribute("RowKey", new Number(1));
    handlePositionChangeEvent("");
    } // end init()
    Thanks
    Anna

  • Clearing WHT on advance & Invoice with same value

    Hi SAP Gurus
    Could anybody suggest me what transaction code to be used or need any configuration change for clearing both the doc i.e. WHT deduct on advance payment with WHT deducted on Invoice with same value.
    In this scenario no further payment should be made.
    I have linked both the doc through TCode F-54 and try to clear both the doc with TCode F-44 but in this transaction no tds has been reveresed by the system and showing difference.
    In Partial advance payment the system has automatically reversed the TDS. No problem occured in this scenario.
    Regards
    Aman
    Edited by: Amandeep Garg on Mar 17, 2008 10:43 AM

    Hi Ahmed
    Thanx for your response...............
    But I have already used the same. Is there not any transaction other than F-53 in which bank is not  invovled.
    Regards
    Aman

  • Advanced table with many columns

    I have a advanced table with more or less 60 columns and the table is greater than the header image. How can I align the table with the advanced table?
    Thanks.
    Edited by: Vieira on 3-giu-2010 1.01

    bedabrata wrote:
    Hi,
    I had a question. Can we fix the size of the lolumns in a table region. I was unable to do so using the property width of the items. So tried the below code:
    // Set width for all the columns
    OATableBean tableBean = (OATableBean)webBean.findIndexedChildRecursive("HeaderDetailsRN") ;
    OAMessageStyledTextBean ColumnStyle;
    ColumnStyle = (OAMessageStyledTextBean)tableBean.findIndexedChildRecursive("SblOrderNumber");
    CSSStyle cellUpperCase = new CSSStyle();
    cellUpperCase.setProperty("width","150px");
    if (ColumnStyle != null)
    ColumnStyle.setInlineStyle(cellUpperCase);
    Now the width is getting set for the cloumn which has values (data) but it is not setting the width for columns which has null value or no data.
    Could any of you guide me on how to set the width for every column of a table region.
    Thanks
    BedabrataOpen an other topic for this. ;-)
    Edited by: Vieira on 3-giu-2010 9.27

  • Rollover button css styled with php function: possible?

    Hi,
    I created a working rollover button css styled, with normal href links, using this html:
    <p class="button"><a href="link"><click here><span>Text</span></a></p>
    But I would like to know how I can create a "contact us" button with following php function included:
    <?=createMailto('[email protected]')?>

    Well, I wrote the button code as mentioned in my first post, but the button does not call the email php function. When I replace the link in a href="link" with the php function, I can't get it to work.
    I have to use href to get the button to display, and to change state on hover; but I don't know how to get the php function to work. Using this function as a plain function call within a regular <p> tag works.

  • Integration Oracle Advance Queue with OSB

    We are doing integration for Oracle Advance Queue with OSB.
    I created an AQ adapter in Jdev and generate the WSDL and XSD.
    I imported both WSDL and XSD in OSB Project.
    When i am configuring the business service and selecting the WSDl i am not able to select Binding and ports, is it due to any issue in WSDL?
    Please help.
    Thanks,
    Mihir Panda

    Hi again,
    I made some adjustments to your wsdl. I added the binding part and its reference to the appropriate port.
    Now I reckon, you should be able to do your thing:
    <wsdl:definitions
    name="enq"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/aq/Applicatio90/Project4/enq"
    xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/aq/Applicatio90/Project4/enq"
    xmlns:opaque="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
    xmlns:obj1="http://xmlns.oracle.com/xdb/APPS"
    xmlns:ph="http://xmlns.oracle.com/pcbpel/adapter/aq/headers/payloadheaders/"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <plt:partnerLinkType name="Enqueue_plt" >
    <plt:role name="Enqueue_role" >
    <plt:portType name="tns:Enqueue_ptt" />
    </plt:role>
    </plt:partnerLinkType>
    <wsdl:types>
    <!-- Define AQ Headers = Payload Headers -->
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/aq/headers/payloadheaders/"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:obj1="http://xmlns.oracle.com/xdb/APPS" >
    <import namespace="http://xmlns.oracle.com/xdb/APPS" schemaLocation="xsd/APPS_WF_EVENT_T.xsd"/>
    <complexType name="enqHeaderCType" >
    <sequence>
    <!-- payload header -->
    <element name="PayloadHeader" type="xs:string" />
    </sequence>
    </complexType>
    <element name="enqHeader" type="ph:enqHeaderCType" />
    </schema>
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
    xmlns="http://www.w3.org/2001/XMLSchema" >
    <element name="opaqueElement" type="base64Binary" />
    </schema>
    </wsdl:types>
    <wsdl:message name="Enqueue_msg">
    <wsdl:part name="opaque" element="opaque:opaqueElement"/>
    </wsdl:message>
    <wsdl:message name="Header_msg">
    <wsdl:part name="Header" element="ph:enqHeader"/>
    </wsdl:message>
    <wsdl:portType name="Enqueue_ptt">
    <wsdl:operation name="Enqueue">
    <wsdl:input message="tns:Enqueue_msg"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="Enqueue_Binding" type="tns:Enqueue_ptt">
         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="Enqueue">
                   <soap:operation soapAction="put_your_own_URI_here"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
              </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="EnqueueService">
         <wsdl:port name="Enqueue_ptt" binding="tns:Enqueue_Binding">
              <soap:address location="No Target Adress"/>
         </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Good luck.
    Regards,
    Ronald

  • Advance Chart with BAR_VERT_STACK

    Hi, I tried to create a chart some dificult for me.
    This is my chart that is generate with rtf.
    !http://img98.imageshack.us/img98/986/chartr.png!
    And this is my code chart.
    chart:
    <Graph seriesEffect="SE_AUTO_GRADIENT" graphType="BAR_VERT_STACK">
    <LegendArea visible="true" />
    <SeriesItems>
    <Series id="0" markerType="MT_BAR" color="#ff0000"/>
    <Series id="1" markerType="MT_BAR" color="#99ccff"/>
    </SeriesItems>
    <LocalGridData colCount="{count(xdoxslt:group(current-group(), 'Proceso'))}" rowCount="2">
    <RowLabels><Label>A</Label><Label>B</Label></RowLabels>
    <ColLabels><xsl:for-each-group select="current-group()" group-by="Proceso" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:sort select="current-group()/Proceso" />
    <Label>
    <xsl:value-of select="current-group()/Proceso"/>
    </Label>
    </xsl:for-each-group>
    </ColLabels>
    <DataValues>
    <RowData>
    <xsl:for-each-group name="Var1" select="current-group()" group-by="Proceso" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:sort select="current-group()/Proceso" />
    <Cell>
    <xsl:value-of select="sum(current-group()/Valor_proceso)" />
    </Cell>
    </xsl:for-each-group>
    </RowData>
    <RowData>
    <xsl:for-each-group select="current-group()" group-by="Proceso" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:sort select="current-group()/Proceso" />
    <Cell>
    <xsl:value-of select="sum(current-group()/Valor_proceso_Aragon)-sum(Valor_proceso)" />
    </Cell>
    </xsl:for-each-group>
    </RowData>
    </DataValues>
    </LocalGridData>
    </Graph>
    Well.
    If you read I substract two values into chart: <xsl:value-of select="sum(current-group()/Valor_proceso_Aragon)-sum(Valor_proceso)" />
    When the result is positive the bar is correct, but when the result is negative the bar is incorrect because 'B' Value is under zero, I know it is normal but I don´t want this.
    This Image generate with MsPaint is result correct for all bars
    !http://img339.imageshack.us/img339/8408/chartwrong.png!
    Finally I think a idea but I don´t know it is possible.
    This is my posible solution:
    1.- For example the case is negative:
    Can I write conditional Ifs into xsl:value-of select and how?
    <?if:number(sum(current-group()/Valor_proceso_Aragon)-sum(Valor_proceso))<0?>sum(Valor_proceso)+sum(current-group()/Valor_proceso_Aragon)-sum(Valor_proceso)<?end if?>
    <?if:number(sum(current-group()/Valor_proceso_Aragon)-sum(Valor_proceso))>0?>sum(current-group()/Valor_proceso_Aragon)-sum(Valor_proceso)<?end if?>
    <xsl:value-of select="<?if:number(sum(current-group()/30)-sum(40))<0?>sum(40)+sum(current-group()/30)-sum(40)<?end if?>" />
    The result is negative but thaks the conditionals now I have a positive result, for example 30(B) becasuse A=40.
    2.-And after I configurate chart for paint transparent bar by "B" and outline bar by B, black.
    Do you understand me? It is very dificult.
    Thanks.

    Carlos,
    I few weeks back you found a solution to a chart issue the yo were having. I am currently having the same issue. Can you share the code for your chart?
    Original Post
    Re: Advance Chart with BAR_VERT_STACK
    Posted: Aug 27, 2009 12:58 PM in response to: Benito Camelas
    Thank you
    Darren

  • Mail error "Verify that you have addressed this message correctly. Check your SMTP server settings in Mail preferences and verify any advanced settings with your system administrator.Select a different outgoing mail server from the list"

    The Mail application has suddenly started giving error:
    "Verify that you have addressed this message correctly. Check your SMTP server settings in Mail preferences and verify any advanced settings with your system administrator.Select a different outgoing mail server from the list"
    It was working fine till yesterday, suddenly it stopped. I have 3 email accounts configured here, 2 are on exchange servers and one yahoo. Connection verification works and shows all servers as green.
    Any inputs?

    I had 3 accounts, 2 ms exchange accounts and 1 yahoo. After removal of yahoo, everything is back to normal.
    Regards
    Rohit

  • Zoom Feature with JTextPane - URGENT

    Hi..friends...
    pl. suggest me way for adding Zoom In and Zoom Out Facility in My JAVA Application with JTextPane which displays Document .
    previously i 've done similler with java.awt.Canvas using java.awt.Graphics2D.scale method....but noe i am confused about how use that method with JTextPane.
    Thanks,
    TP.

    If you need to zoom only text (not the whole html page with images, etc ...) you may look at StyleSheet.getFont() method. All the HTML views fetch their font through this method and if you override it in your own StyleSheet implementation you may substitute your font with increased size.
    Hope this helps.
    Regards,
    Anton.

  • Links styled with setStyle positioning issue

    Hi,
    I have a dynamic text field where I have the basic latin characters of Georgia embedded.  I am then loading a text file into this as htmlText.  Everything works OK except when I style the links the spacing before them gets messed up.  Some of them appear to have no space until you hover, some move to the left about half a pixel on hovering.  I made sure that my text field's position is set to whole numbers and it still does it, I also tried removing my styling and that seems to eliminate the problem.
    This is the code I am using:
    import flash.text.StyleSheet;
    import flash.events.TextEvent;
    var style:StyleSheet = new StyleSheet();
    var hover:Object = new Object();
    hover.color = "#18a0cf";
    var link:Object = new Object();
    link.color = "#29C2F7";
    var active:Object = new Object();
    active.color = "#29C2F7";
    var visited:Object = new Object();
    visited.color = "#29C2F7";
    style.setStyle("a:link", link);
    style.setStyle("a:hover", hover);
    style.setStyle("a:active", active);
    style.setStyle(".visited", visited);
    myText.styleSheet = style;
    Thank you in advance for your help!

    You cannot style a textfield with setStyle, since that is only for components.  You need to use TextFormat.

Maybe you are looking for