JTextPane and HyperLinks

I've got a JTextPane that reads in htm file. It displays fine, but the hyperlinks though underlined and blue do not behave like hyperlinks. Any ideas?
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.*;
import java.io.*;
import javax.swing.text.*;
import javax.swing.text.rtf.*;
import javax.swing.event.*;
public class test extends JApplet implements HyperlinkListener
     public void init()
          JTextPane str = new JTextPane();
          try
               str.setPage(getCodeBase() + "htmlfile.htm");
               str.addHyperlinkListener(this);
          catch (Exception e)
               e.printStackTrace();
          getContentPane().add(str);
     public void hyperlinkUpdate(HyperlinkEvent h)
          System.out.println(h);
}

never mind.
must be uneditable. Duh.
setEditable(false);

Similar Messages

  • Insert String to JTextPane as hyperlink

    Hi,
    I have a JTabbedPane with 2 tabs, on each tab is one panel.
    On first pannel I add JTextPane and I would like to insert in this JTextPane some hyperlinks.
    I found some examples in forum, but doesn't work for me.
    Could somebody help me ?
    Thank's.
    Here is my code :
    JTextPane textPane = new JTextPane();
    textPane.setPreferredSize(new Dimension(500,300));
    HTMLEditorKit m_kit = new HTMLEditorKit();
    textPane.setEditorKit(m_kit);
    StyledDocument m_doc = textPane.getStyledDocument();
    textPane.setEditable(false); // only then hyperlinks will work
    panel1.add( textPane,BorderLayout.CENTER); //add textPane to panel of
    //JTabbedPane
    String s = new String("http://google.com");
    SimpleAttributeSet attr2 = new SimpleAttributeSet();
    attr2.addAttribute(StyleConstants.NameAttribute, HTML.Tag.A);
    attr2.addAttribute(HTML.Attribute.HREF, s);
    try{
    m_doc.insertString(m_doc.getLength(), s, attr2);
    }catch(Exception excp){};
    The String s is displayed like text not like hyperlink..

    Hi , You can take a look at this code , this code inserts a string into a StyledDocument in a JTextPane as a hyperlink and on clicking fires the URL on the browser.
    /* Demonstrating creation of a hyperlink inside a StyledDocument in a JTextPane */
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.Border;
    import javax.swing.text.*;
    public class Hyperlink extends JFrame {
        private Container container = getContentPane();
        private int toolXPosition;
        private int toolYPosition;
        private JPanel headingPanel = new JPanel();
        private JPanel closingPanel = new JPanel();
        private final static String LINK_ATTRIBUTE = "linkact";
        private JTextPane textPane;
        private StyledDocument doc;
        Hyperlink() {
              try {
                   setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
                   setSize(300, 200);
                   Rectangle containerDimension = getBounds();
                   toolXPosition = (screenDimension.width - containerDimension.width) / 10;
                            toolYPosition = (screenDimension.height - containerDimension.height) / 15;
                            setTitle("HYPERLINK TESTER");
                         setLocation(toolXPosition, toolYPosition);
                         container.add(BorderLayout.NORTH, headingPanel);
                         container.add(BorderLayout.SOUTH, closingPanel);
                   JScrollPane scrollableTextPane;
                   textPane = new JTextPane();
                   //for detecting clicks
                   textPane.addMouseListener(new TextClickListener());
                   //for detecting motion
                   textPane.addMouseMotionListener(new TextMotionListener());
                   textPane.setEditable(false);
                   scrollableTextPane = new JScrollPane(textPane);
                   container.add(BorderLayout.CENTER, scrollableTextPane);
                   container.setVisible(true);
                   textPane.setText("");
                   doc = textPane.getStyledDocument();
                   Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
                   String url = "http://www.google.com";
                   //create the style for the hyperlink
                   Style regularBlue = doc.addStyle("regularBlue", def);
                   StyleConstants.setForeground(regularBlue, Color.BLUE);
                   StyleConstants.setUnderline(regularBlue,true);
                   regularBlue.addAttribute(LINK_ATTRIBUTE,new URLLinkAction(url));
                   Style bold = doc.addStyle("bold", def);
                   StyleConstants.setBold(bold, true);
                   StyleConstants.setForeground(bold, Color.GRAY);
                   doc.insertString(doc.getLength(), "\nStarting HyperLink Creation in a document\n\n", bold);
                   doc.insertString(doc.getLength(), "\n",bold);
                   doc.insertString(doc.getLength(),url,regularBlue);
                   doc.insertString(doc.getLength(), "\n\n\n", bold);
                   textPane.setCaretPosition(0);
              catch (Exception e) {
         public static void main(String[] args) {
              Hyperlink hp = new Hyperlink();
              hp.setVisible(true);
         private class TextClickListener extends MouseAdapter {
                 public void mouseClicked( MouseEvent e ) {
                  try{
                      Element elem = doc.getCharacterElement(textPane.viewToModel(e.getPoint()));
                       AttributeSet as = elem.getAttributes();
                       URLLinkAction fla = (URLLinkAction)as.getAttribute(LINK_ATTRIBUTE);
                      if(fla != null)
                           fla.execute();
                  catch(Exception x) {
                       x.printStackTrace();
         private class TextMotionListener extends MouseInputAdapter {
              public void mouseMoved(MouseEvent e) {
                   Element elem = doc.getCharacterElement( textPane.viewToModel(e.getPoint()));
                   AttributeSet as = elem.getAttributes();
                   if(StyleConstants.isUnderline(as))
                        textPane.setCursor(new Cursor(Cursor.HAND_CURSOR));
                   else
                        textPane.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
         private class URLLinkAction extends AbstractAction{
              private String url;
              URLLinkAction(String bac)
                   url=bac;
                 protected void execute() {
                          try {
                               String osName = System.getProperty("os.name").toLowerCase();
                              Runtime rt = Runtime.getRuntime();
                        if (osName.indexOf( "win" ) >= 0) {
                                   rt.exec( "rundll32 url.dll,FileProtocolHandler " + url);
                                    else if (osName.indexOf("mac") >= 0) {
                                      rt.exec( "open " + url);
                              else if (osName.indexOf("ix") >=0 || osName.indexOf("ux") >=0 || osName.indexOf("sun") >=0) {
                                   String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror",
                                     "netscape","opera","links","lynx"};
                                   // Build a command string which looks like "browser1 "url" || browser2 "url" ||..."
                                   StringBuffer cmd = new StringBuffer();
                                   for (int i = 0 ; i < browsers.length ; i++)
                                        cmd.append((i == 0  ? "" : " || " ) + browsers[i] +" \"" + url + "\" ");
                                   rt.exec(new String[] { "sh", "-c", cmd.toString() });
                   catch (Exception ex)
                        ex.printStackTrace();
                 public void actionPerformed(ActionEvent e){
                         execute();
    }Here , what I have done is associated a mouseListener and a mouseMotionListener with the JTextPane and I have created the hyperlink look with a Style of blue color and underline and have added the LINK_ATTRIBUTE to that Style which takes care of listening to mouse clicks and mouse motion.
    The browser can be started in windows using the default FileProtocolHandler using rundll32 and in Unix/Sun we have to take a wild guess at which browser could be installed , the first browser encountered is started , in Mac open command takes care of starting the browser.
    Hope this is useful.

  • 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.

  • CS3 - How can I preserve Links and Hyperlinks in my INDB?

    I am still pretty new to ID, so please speak slowly :)
    My problem - I create an INDB that consists of several indd chapters. The chapters include numerous Links (to PNG & PSD images) and Hyperlinks both to Text anchors to other chapters within the INDB, as well as to URLs. I have all items saved on my local HD. Once complete, I do "Package for Print", check the Preflight report to make sure all is OK (it is) and then save the new INDB folder in a new location on my local HD. This all seems to work just fine, BUT if I move this packaged INDB folder (such as to a backup drive, or give to another worker that copies it to their HD), upon opening the INDB file, some links and Hyperlinks are broken.
    It seems that these broken Links and Hyperlinks are still pointing to the original locations on my HD. But obviously not all are, since most links/hyperlinks DO work fine. The Hyperlinks to Text anchors within other indd chapters seem to typically break. Is there a way to force these to reference the packaged assets within the INDB folder? Seems ID would be smart enough to look there itself!
    Also, I was creating some Hyperlinks as "cross referenced" - that is, I created a URL Hyperlink Destination in Chapter 1 indd and then created Hyperlinks pointing to it from other chapter indd in the book. I have learned that these ALWAYS break in the above scenario, so I started creating the URL destination within the same chapter indd and pointing to it there rather than across chapters. But this is just more work to keep re-creating the same URL destination in every indd!
    I'll keep running into these problems since I need to share my finished INDB with other CS3 users. I also would like to be able to do a Save As of the INDB when creating a revised, newer version, but I see this also results in the new INDB links/hyperlinks still pointing to the original INDB's assets! Any way to make the Save As update the Links/Hyperlinks in the new INDB?
    Thanks greatly for any insight. I can find no help in the Help on these issues!

    The title of the post is this
    How can I preserve row and column addresses on multiple cells at once in Numbers?
    I restated the Question as follows
    Can "Preserve Row" an / or "Preserve Column" be set on multiple cells at the same time.
    In both cases it is not asked if multiple cells can be set to....
    That is a given.
    Step back a second...  It is like selecting multiple cells and setting the text color of the currently selected cells to red. This can be done. More than one cell at a time modified because they are currently selected.
    Whats is being asked is:  if more than one cell is selected at the same time can the settings "Preserve Row" an / or "Preserve Column" be applied. No table I put up will help with that question.
    YES or NO
    If YES how?

  • Image instead of List Name, and hyperlink the image to view 'All Items.aspx' page

    Hi,
    I would like remove the Page title for list (i.e., name of the list in view all items.aspx page) , and instead use image and hyperlink the image
    to 'All items.aspx" page.
    Using developer tool found the element (#PageTitle) and added 'Script Editor' webpart and below css script to it. I am successful in replace the
    title to image, however, I am unable to add the HTML tag for hyperlink. Where do I need to add or how do I add? Could anyone help me please??
    <style type="text/css">
    #pageTitle
    background-image: url('http://w2k81368:2116/SiteAssets/Test.jpg');
    background-repeat:no-repeat;
    text-indent: 100%;
    white-space: nowrap;
    </style>
    Regards,
    Sunitha

    Hi Sunitha,
    According to your description, my understanding is that you want to change the list title to an image.
    I recommend to add the code below to the list page:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function (){
    var s = "<img alt='SP' src='http://w2k81368:2116/SiteAssets/Test.jpg'>";
    var $t = $("#DeltaPlaceHolderPageTitleInTitleArea span span a");
    $t.html(s);
    </script>
    After that, the list title will change to the image and it will show allitems.aspx page when clicking the image.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Problems with Long Interactive PDFs with Extensive Interactivity via Buttons and Hyperlinks

    I have inherited a project which requires the creation of large interactive pdfs with lots of buttons and hyperlinks. I am having continuing problems with buttons not working and long periods of wasted time as attempted exports fail.
    Background:
    The largest books range from 264 MB to 411 MB – (764 to 1024 pages).  Per book, the maximum number of buttons on each page is 16, linking separate files (subsections) in the book via text anchors.  The buttons are created using Master Pages which are set for each file (subsection) in the book.  50% to 60% of the pages in each file (subsection) will also be referenced as 2 hyperlinks.  One is the source page hyperlink on each workflow and the second is a listing on the source page as a possible navigation path. I have created hyperlink destinations for each page which is used to generate the source and navigation hyperlinks.  With 2 hyperlinks representing 50%-60% of the pages - that means the largest book contains a maximum of 1200 hyperlinks.  Each file (subsection) also has it’s own separate TOC and the bookmarks that are created  (optionally) during the TOC creation process.   As currenlty formatted, the book is primarily images of workflows which mean 50%-60% of the pages contain pdf images.
    Several questions:
    1.  How do I get my buttons to work consistently?  There is nothing worse than working hard and then ending up with faulty product.  I have been thinking about combining all the files into 1 document per book.  Then I could change the buttons to objects, add a hyperlink over each one and set them for a specific hyperlink destination.  Can I do that if the buttons are on Master Pages?  Can InDesign handle a document with 1024 pages?    I can't fix the problems in Acrobat later because it would mean 1024 fixes for just 1 button correction.
    2.  How do I stop InDesign from freezing when exporting these large pdfs?  It seems to wait until the final steps to crash which sometimes means a 4-6 hour waste of time per export. 
    3.  Are we making a mistake using pdfs as our workflow images?  I'm not pleased with the quality of the images we have and wonder if we switched to another image format if this would improve the results.   Would it be worth the effort and relinking?  I have been reading different information on what the preferred source image format is for InDesign.  One article I found yesterday says using pdf images is a problem.  Another site said the Photoshop, TIF and JPG are preferred but PDFs were also acceptable.
    4.  Do I need to propose scrapping InDesign as the source of the project?  If so, what application can better meet my needs?

    Those are the limitations you have to put up with.
    Apple doesn't follow the PDF spec. It chooses which PDF features it will support.
    As to the version number (v5 or v6 or the new multimedia features in v9), there is different support in different versions of Reader/Acrobat as the product has developed. You just need to post a message to downloaders that they need to view the file in Adobe Reader version X or above to get the best experience.
    Other industry standards face the same problem: How can you add new feature like multimedia? You can't always be backwards compatible.

  • PDF and Hyperlinks in SRM-MDM Catalog

    Hello friends,
                       I have done all the prerequisites that are needed in datamanager to upload the PDF's and Hyperlinks but the problem is whenever i see my catalog's search UI in that I am unable to see all the PDF links and even hyperlinks.
    Please do suggest........
    Regards Dollar Man

    Hello Dollar man,
    On the MDM Console, right click on the Repository -> Properties -> PDF -> Allow invalid PDFs -> Yes .
    Give points if it is  aHelpful answer
    Regards,
    Chinmoy

  • An hour ago, I accidentally deleted a "Bookmarks" folder, and all of subfolders and hyperlinks. The lost items are not in "Trash." Are they still retrievable? JAW

    An hour ago, I accidentally deleted a Bookmarks folder, and all of subfolders and hyperlinks. The lost items are not in "Trash." Are they still retrievable? JAW

    They don't go into the Trash. Unless you have a backup prior to the deletion time it's gone.

  • Obnoxious JTextPane and JScrollPane problem.

    I have written a Tailing program. All works great except for one really annoying issue with my JScollPane. I will do my best to explain the problem:
    The program will continue tailing a file and adding the text to the JTextPane. When a user scrolls up on the JScrollPane, the program still adds the text to the bottom of the JTextPane and the user can continue to view what they need.
    Here is the problem: I have text being colored throughout the text pane. For instance, the word ERROR will be in red. The problem is when the program colors the text, it moves the scroll pane to the line where word that was colored is at. I don't want that. If the user moves the scroll bar, I want the scroll bar to always stay there. I don't want the program to move to the text that was just colored.
    Is there a way to turn that off? I can't find anything like that anywhere.

    Coloring text will not cause the scrollpane to scroll.
    You must be playing with the caret position or something.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • We created a pdf document with comments and hyperlinks. On iPad, comments/hyperlinks disappear.

    Using Acrobat Pro 9, we created a pdf with comments and hyperlinks to be shared with a large community on the iPad, through a server. Once the document is opened on the iPad, all the comments and hyperlinks disappear. Are we missing a tool on the iPad or is there a different way to create this file? Thank you.

    Is everyone on the iPad using the latest version of Adobe Reader mobile for iOS (10.6 at the moment)? You can see all the comments (including drawing markups) as well as view the notes attached to text markup with this version.

  • Table of Contents links and hyperlinks lose accuracy in FP past 5 pages?

    I've come up dry searching for any mention of this bug
    anywhere.
    We've got Word documents that have a table of contents (TOC
    created dynamically in word, using the standard "Heading" style
    method.) When we convert these to Flashpaper SWFs, about 50% of the
    TOC links don't work - they go sort of nearby spots in the
    document, but bring you to a spot off by half a page or more. The
    links to spots in the first 4-5 pages work ok, but TOC links that
    go deeper into the doc - from 5 to 20 pages in - those are off by a
    half page to a page. The working TOC links in Word or in PDF
    versions of the doc take you directly to the right spot.
    The "outline" option in flashpaper also fails - the outline
    links past 5 pages or so are innacurate just like the in-document
    links.
    According the the (scanty) documentation for Flashpaper,
    Heading/Outlines, etc. are supposed to work fine and get converted
    into the SWF.
    I've already tried creating fresh example files, to make sure
    it isn't a problem with sloppy Word formatting, extra Headings,
    etc. - no dice. I still get TOC and outline links that fail to work
    in many cases. They mostly fail for things that jump to spots after
    5-6 pages into the doc. But if I convert these same docs to PDFs,
    the PDF bookmarks and TOC links and hyperlinks work perfectly.
    We've also tried using Hyperlinks in Word to create "pretend"
    Table of Contents (not dynamic, but we're desperate), and we find
    that those hyperlinks that go past 5 or 6 pages into the 20 page
    doc lose their acuracy also - they are a half to a full page off.
    We already tried the method of saving the word docs as HTML
    then converting to FP(suggested within this board) but that did not
    improve things.
    Thanks in advance.
    - Chris

    We solved our issue. In our case we have Word 2007, but our
    client is still on Word 2003 so our Word document was originally
    created in Word 2007 and then converted by Word 2007 into the Word
    2003 format. It appears that we were having these problems because
    we were running Flashpaper on the coverted Word document. A
    document converted this way is internally different than a document
    created by the Word 2003 application.
    To fix the problem we downloaded the Word 2003 application,
    created a new Word 2003 document, copy and pasted the contents of
    the converted Word document into the document created on Word 2003,
    and then ran Flashpaper on the new Word 2003 document. Problem
    solved.

  • JTextPane and Horizontal Scrollbars

    Hi there,
    I had written an app that included an Event Log, and all was good in my
    world.
    Then one of the app users commented they would like errors to stand out within the log!
    I said "No Problem" but it turns out to be a major bloody headache!!!!!
    I was using a JTextArea but after reading some posts on this forum I decided to use a JTextPane. I found some code for changing the font colour, and everything appeared to be working fine ;-)
    ...until that is I realised my HORIZONTAL_SCROLLBAR_AS_NEEDED was never needed as the text had started to wrap ;-(
    I have tried searching this site and none of the suggestions work for me, the vertical scroll works fine - and I am really stuck. Therefore:
    Is there a way to get the Horizontal scroll bar working in a JTextPane?
    Is there an alternative to JTextPane that will allow me to control font colour by line?
    Do you even know what I am harping on about?
    Or should I admit defeat and add a second JTextArea and a button to switch between my two event types??
    Any suggestions would be greatly received!
    P.S. Below is the edited code that I think is responsible for my problem :0)
    public class EventLogGUI extends JPanel
    private JPanel jpLog = new JPanel();
    private StyledDocument sdLog = new DefaultStyledDocument();
    private JTextPane jtpLog = new JTextPane( sdLog );
    private MutableAttributeSet mas = new SimpleAttributeSet();
    private JScrollPane jspLog;
              public EventLogGUI()
              this.setBounds( 5, 7, 407, 256 );
              this.setBorder( BorderFactory.createLoweredBevelBorder() );
              this.setLayout( null );
              this.add( jpLog );
              jspLog = new JScrollPane( jtpLog,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
              jspLog.setBounds( 12, 25, 372, 180 );
              jpLog.setLayout( null );
              jpLog.setBounds( 5, 5, 397, 218 );
              jpLog.add( jspLog );
              jtpLog.setEditable( false );
              jtpLog.setMargin( new Insets ( 2, 2, 2, 2 ) );
              public void initialiseGUI()
              Vector events = uploadEventLog();
              String event;
              jtpLog.setText( "" );
                        for ( int i = 0; i < events.size(); i++ )
                        event = "" + events.elementAt( i );
                                  if ( event.length() >= 8 && event.substring( 0, 8 ).equals( "WARNING:" ) )
                                            StyleConstants.setForeground( mas, Color.red );
                                  else
                                            StyleConstants.setForeground( mas, Color.black );
                                  try
                                  sdLog.insertString( sdLog.getLength(), event + "\n", mas );
                                  catch( Exception e )
    }

    Hi!
    just wondered if you've searched the forum already. If not: always do that before posting.
    I searched and found this helpful:
    http://forum&threadID=256602
    the solution found in that thread is to extend the JTextPane and add a setLineWrap-method:
    class JTextWrapPane extends JTextPane {
        boolean wrapState = true;
        JTextArea j = new JTextArea();
         * Constructor
        JTextWrapPane() {
            super();
        public JTextWrapPane(StyledDocument p_oSdLog) {
            super(p_oSdLog);
        public boolean getScrollableTracksViewportWidth() {
            return wrapState;
        public void setLineWrap(boolean wrap) {
            wrapState = wrap;
        public boolean getLineWrap(boolean wrap) {
            return wrapState;
    }  now you can use JTextWrapPane instead of JTextPane:
    //  instead of   private JTextPane jtpLog = new JTextPane( sdLog );
        private JTextWrapPane jtpLog = new JTextWrapPane( sdLog );and set JTextWrapPane.setLineWrap(false):
            jtpLog.setLineWrap(false);It may not be the non plus ultra, but it seamed to work for me. ;)

  • Equipment/Functional Location Attachments and Hyperlinks Batch Upload

    Hi,
    We would like to upload File attachments or create Hyperlinks for a reference object in batch - an equipment using transaction IE02 or a functional location IL02. We have already tried creating an LSMW for this however attachments and hyperlinks are deactivated using the LSMW functionality.
    Could you kindly advice?

    Hi,
    I guess you are trying to attach the Hyperlink and documents for individual objects through the generic object services(GOS).If thats the case the standard Generic object services does not support background process and hence the unavailability of the same in LSMW.
    However you can create a separate custom program to create attachments to individual objects using the class and Methods associated with Generic object services (GOS).
    The Method that you would need to use is "CL_BINARY_RELATION=>CREATE_LINK" associated to class "CL_BINARY_RELATION ". There are sample codes available in ABAP development forum to do exactly the same.
    Regards
    Narasimhan

  • Pop up windows and hyperlinks on websites - Virus???

    I hope someone can help me with this pretty fast since I can't figure out how to fix it anywhere, and it slows down my working progress.. I recently started to get a whole bunch of pop up windows (usually when I click on a "search" window, for instance google) and hyperlinks on random words on the web-side I'm on (it can be any word on youtube, facebook, everything that usually are not a link). I've seen more people talk about macdefender etc, but I can't find this anywhere on my mac, so could it be anything else? And what should I do..?

    mdscardigno wrote:
    I ran Adware Medic and it did not find any adware. The problem still persists.
    That is either because your problem isn't actually due to adware, or you've got some adware I've never seen, and thus have never incorporated into AdwareMedic's signatures.
    First, take a look here at some alternate, non-adware-related solutions to the problem:
    http://www.adwaremedic.com/kb/unsolved.php
    If none of that helps, you may have new adware. In that case, take a system snapshot with AdwareMedic and submit it. I'll take a look and see what I can find.
    (Fair disclosure: I may receive compensation from links to my site and software, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • If I use my iPad2 to present presentations created in MS Powerpoint, will I retain the embedded videos and hyperlinks that were created in the original presentation

    I want to use my iPad2 to make presentations created in MS Powerpoint. These have embedded videos, animations and hyperlinks. Will these all work in the spreadsheet if I use Keynote on my iPad to display and present them.

    I have another problem.
    I have deleted all apps from my iPhone 4s and then I have changed my
    Apple ID's country information from Poland to United States.
    After that, I have downloaded all deleted apps.
    But only few are in 'Purchased' section on iPhone!
    I guess only these, I have downloaded using USA App Store, not Polish.
    I am getting frustrated, because I have got too many problems with iOS
    and it doesn't look it will get better... Please help me ASAP! Thanks!

Maybe you are looking for

  • Getting selected values from selectManyChoice component inside valueChangeListener

    Hwo do I get the selected values from the selectManyChoice component inside the valueChangeListener. The API docs for valueChangeEvent.getNewValue() show the return type as java.lang.object. This is good for single value what does it return in case o

  • Posting an Excel file to a FTP Server

    Hi, I have a requirement, where I have to convert the contents of an internal table to an excel file, along with header details and put that file to a FTP Server. I am able to create an excel file in FTP server, using function module FTP_R3_TO_SERVER

  • How to compare dates in a select query in open sql

    Hi                    How can I retrieve data pertaining to a specified date using a select query. I have inserted date using the following code: String dateString = "2009-03-11"; java.sql.Date date = java.sql.Date.valueOf(dateString); PreparedStatem

  • Error accessing Inventory Collaboration Hub (ICH) BSP Pages

    Hi I am trying to access basic ICH page in SCM 4.0 as well as SCM 4.1. I am getting the following error: BSP exception: Access to page default.htm requires HTTPS. HTTPS has not been configured on this server. Regular BSPs are working fine in both the

  • Using a MacBook with ONLY a Power Adapter

    HI! is it possible to use my MacBook with just the power adapter? The current batter and adapter are both dead, and I'm pretty low on cash. So I was thinking I would purchase a new adapter in Amazon. Thoughts? Thanks.