Jumping to a specified text passage or panel

hi,
in a swing-application, I�ve a tree with categories and themes in one JTabbedPane and a list of text passages in a JScrollPane in another JTabbedPane.
now i want tu jump to the suitable textpassage by clicking a category/theme in the tree (like the anchors in html).
please, can anybody help me?
thanks,
dagmar

For your content pane, I would use a JEditorPane. You can use the setPage(URL url) or setPage(String url) methods to display HTML pages in the JEditorPane. When loading these pages, the editor pane will follow anchors in the URL:
JEditorPane content = new JEditorPane();
content.setPage("http://java.sun.com/");The setPage method loads pages asynchronously, so it make take a moment for the document to appear. You can load pages from files on your local filesystem too:
// Continued from above..
File theFile = new File("C:/myFolder/myFile.html");
// You should specify the content type of the document when loading
// from elsewhere than a web server
content.setContentType("text/html");
// Load from URL: file:/c:/myFolder/myFile.html
content.setPage(theFile.toURL());Suppose there was an anchor tag named "summary" in your html document. To load the document and skip to that anchor, just give setPage() a URL with an anchor, just like in a web browser:
// Load from URL: file:/c:/myFolder/myFile.html#summary
content.setPage(theFile.toURL().toString()+"#summary");You can set up the JTree in the contents pane of your app so that when you double click a node, the URL corresponding to that node is loaded.
Hope this helps.

Similar Messages

  • Is there a way to specify text-to-speech to dictate a specific line or..

    Hi guys,
    Is there a way to specify text-to-speech to dictate a specific line or page in a pdf file?
    In fact, it would be cool if text-to-speech highlighted each word that is being spoken through out the document during dictation and you could rewind, pause or fastforward the speech in real-time. Is this feature available? if not, can anyone recommend any other programs that can do this?
    thanx in advance

    Is there a way to specify text-to-speech to dictate a specific line or page in a pdf file?
    Yes!
    With fully modern Cocoa applications (like Safari, Preview, TextEdit, and Mail) you can select the line or page and then from the application menu > Services > Speech > Start Speaking Text
    You can also select and then Control-Click on the selection and then pick Speech > Start Speaking Text from the contextual menu. (Works with Safari, TextEdit, and Mail, but not Preview for PDF.)
    In fact, it would be cool if text-to-speech
    highlighted each word that is being spoken through
    out the document during dictation and you could
    rewind, pause or fastforward the speech in real-time.
    That would be cool. Are you looking for an interface enhancement, or would a talking book reader with these features be acceptable?
    Is this feature available?
    No, but you can get somewhat close to this ideal by using VoiceOver and checking Show Caption Panel.
    if not, can anyone recommend any other programs that can do this?
    I have had fair success with the Text Help Read & Write Aloud products.
    http://www.texthelp.com/rwm.asp?q1=products&q2=rwm
    eMac 1.42   Mac OS X (10.4.6)   I paid the going Windows price for a screen reader and got a free computer!

  • Multi-language support for user-specified text strings used in the forms

    multi-language support for user-specified text strings used in the forms
    Instead of creating multiple forms, 1 in each different language, for the same service, is there any workaround?

    Hoan - is your question what are the considerations when creating multiligual catalogs? If so, I can tell you that at other clients I have seen them use a single catalog for one or two languages. For the two langugages, such as Spanish/English, you can create a single catalog with both of them. Once you get to more than two languages, the catalog would get unweildy and is therefore not suggested.

  • Jump down in flash text box

    Hey guys, I need help! -- I am new to flash.
    I have a scrolling text box with text and images in it. I
    need to know how I can put text at the top that they can click and
    then it will jump down in the text box to a specific location, can
    anyone help please.

    Hi,
    I got your file. Yeah, that scroll pane is impressive.
    But, the images are not residing in the text box they put.
    Really, that text box (scroll content gallery.scroll
    pane.txtContent.txt) is not needed. (If you delete that text box,
    then also the scroll pane will work fine). They used that text box
    only to show the texts
    'VISIONERY POSTER PRODUCTS' and '- Scroll down with the pink
    bar on the right -'.
    The remaining texts like......Fine Art Reprints:,
    'Wallpapers:', 'Backlits:', etc. are put in seperate static text
    boxes and then be converted into movie clips.
    To check......cut that text box (scroll content
    gallery.scroll pane.txtContent.txt) and double click on each of
    'Wallpapers:', 'Backlits:', etc. (Don't click on Fine Art Reprints:
    because the mask is hiding it)

  • "get specified text" - how to pipe its result to next action in my Automato

    trying to understand Automator's "get specified text" action. It seems to ask a question in the middle of a workflow, to which you input the answer. I want to pipe its output to the next action, ie, ask the user for a text string to which a text stamp will be applied to a multi-page PDF. Similiar to what Adobe Acrobat Pro can do if you go Documents/Add/Watermark.
    There must be a simpler way then to spring for $500 to get a text stamp (basically a script's authors name) as a large diagonal background across all pages of a script thats been turned into a pdf.
    Any suggestions or ideas are welcome. Im going to attempt to provide this solution free to the Mac community, since I couldnt find one out there.

    OK, that makes a little more sense.
    The Watermark PDF Files action isn't going to do what you want - at least not without a little more work.
    If you look at the Automator definition of that action it requires a list of files as its input. You can't pass in a piece of text to use as the watermark.
    Therefore the 'Watermark PDF Files' action can follow the 'Get Selected Finder Items' (since that returns a list of files), but the watermark action requires the watermark be specified at build time - you can't add a dynamic watermark at runtime.
    In addition to that, the watermark action requires an image file to be used as the watermark, not a piece of text.
    The only Automator solution I can see to this would be to have one action that asks for text and generates a corresponding image file. This can then be used as the watermark file by the action. Off-hand, though, I can't see an easy Automator way to create an image file from an arbitrary piece of text...

  • Is it possible to find an xmlelement inside a specified text frame or in specified page?

    Hi All
    Is it possible to find an xmlelement inside a specified text frame or in a specified page?
    Regards,
    Chinna

    Try this (not tested...)
    app.findGrepPreferences = app.changeGrepPreferences = null;   
    app.findGrepPreferences.findWhat = "\\d+|\\w+";   
    found = app.selection[0].findGrep (false);  
    for (j = 0; j < found.length; j++)  
        if(found[j].texts[0].associatedXMLElements[0].markupTag.name == "xref")
            found[j].texts[0].associatedXMLElements[0].select();
    Vandy

  • False Overset Text in Links Panel

    Mac OX 10.6.4
    CS5
    This is the problem I'm encountering: When I export to .pdf, Indesign Crashes. I've been able to narrow it down to one specific file and actually specific pages. But here is something I've noticed and cannot figure out. I've got three .psd linked files that are showing up as overset (OV) in the links panel, therefore when I click on them ID says it can't show me them because they are in over set text. But my live preflight says there is no over set text. ID jumps to pages still when I click that link but that whole story has no overset text. (i.e. not red overset in the outbox and no overset text in story editor mode. I can't figure out where those three linked objects are or how to select them to delete them. Any thoughts?

    I would suggest running through the same steps as above (which it sounds like you've done) to see if you can isolate a problem, and in addition you might want to try exporting the stories to InDesign Tagged Text, then create a new file, move over the master pages, and place all the exported stories.
    Also, be sure everyone is updated to the 7.5.3 patch.
    dcald wrote:
    The links panel indicates that the images are in overset text but we know for a fact that they are from a previous issue and are no longer in the ID file. Also, preflight indicates that there is no overset text in the file. It is one flow thoughout the entire file. Attempts to create PDF fail consistently. Each time someone has had to build the file again from scratch which for a file over 60 pages long, is not good for feelings towards the ID/InCopy.
    This implies to me that you "recycle" document instead of building a template. ID is pretty stable, but no layout program is perfect and each time you do a save you introduce the possibility of small errors in the file. Somnetimes those small errors become big problems.
    You can reduce the risk of problems on recurring publications by creating a template that contains your master pages, color swatches, styles, and any "static" content that might not be on a master page but still does not change from version to version. Each new version should be made from the template, so it is always a fresh second-generation copy.

  • Help with problem specifying text properties (style & antiAliasMethod)

    I would be very grateful if someone could help me figure out what I am doing wrong in specifying certain text properties, namely style and antiAliasMethod.  I have tried many different things and consulted the JavaScript Reference Guide, Tools Guide and PS CS4 Scripting Guide, as well as several example scripts, but I can't seem to find the information needed.
    The snippet of code below adds a text layer to a document and places text on it;  What I want is white Arial bold 10 point text with no antialiasing (this would appear as "none" in the PS CS4 text tool dialog).  This code does everything except get the bold property and the antialiasing = none property.  Instead, what this code produces is white Arial normal (not bold) crisp (not none) text,
    My attempt to get no antialiasing instead of "crisp" causes an execution error, so that line is commented out below.  The line setting style to "BOLD" does not create an execution error, but it doesn't give me bold, either (instead I get normal).
    I am certain these errors mean I do not understand the correct way to express the code to set these properties.  Can someone set me straight about how to do this?
    Thanks.
            // Create a new text layer at the top of the document
            var myLayerRef = newDocRef.artLayers.add();
            myLayerRef.kind = LayerKind.TEXT;
            myLayerRef.name = "Test";
            var myTextRef = myLayerRef.textItem;
            // Set the text color, font, size, etc.
            var textColor = new SolidColor;
            textColor.rgb.red = 255;
            textColor.rgb.green = 255;
            textColor.rgb.blue = 255;
            myTextRef.color = textColor;
            myTextRef.font = "ArialMT";
            myTextRef.style = "BOLD";
    //        myTextRef.antiAliasMethod = "NONE";
            myTextRef.size = 10;
            // Set the text position, blend mode and opacity
            var tx = 10;
            var ty = 50;       
            myTextRef.position = new Array(tx,ty);
            myLayerRef.blendMode = BlendMode.NORMAL;
            myLayerRef.opacity = 100;
            // Insert the text
            myTextRef.contents = "Hello World";

    Update:
    I discovered how to fix both problems myself.
    The antialiasing was fixed by statement: myTextRef.antiAliasMethod = AntiAlias.NONE;
    The bold problem was fixed by changing the font name to "Arial-BoldMT" and deleting the statement which attempted to set the style to "BOLD".
    Thanks for your interest.  No further help is needed on this issue.

  • Text-to-speech is jumping over sections of text.

    Text-to-speech will sometimes miss saying sections of text.
    My guess is that it is when the processor has too much other work to do (ie. rendering the remainder of a page).
    The only flaw is that during times when it stops speaking, it still continues to move through the text.  As a result when it continues to speek it has left some of the words out.
    Is there an option to prevent it jumping sections of text when overloaded?

    lllaass wrote:
    What is the source of the text? Are the non-spoken works different? Is there a pattern to them?
    An example would be the selection of a paragraph of text from a web page in safari.
    The text is selected, "Speak" is selected from the popup options and it may start to speak, but pause for a period of time and when it is talking again it has jumped over a number of words.

  • Why is the text in the panels so small?

    I am new to Indesign. In fact I am evalutating for use at my company.
    The panels are pretty much unusalbe, the text is way to small.
    It looks like it is about a 6pt font.
    Please someone tell me there is a way to change this.

    I too am evaluating indesign for use in a Product Design group for a major engineering software manufacturer.   Sometimes in software design we have to make concessions that no one likes in order to achieve our goals.  With our products we usually address any concessions in a follow up release.  I hope that Adobe has been forced into this situation and has not willingly chosen to forgo rudimentary functionality. From what I have observed with indesign CS4 I am unimpressed.  Here are a couple of my observations.
    1.     As stated the UI is missing basic user controls like the ability to change the font size.
    2.     Vertically docking toolbars on the side of the screen is limited to a few bars.  Any additional toolbars are forced into a side-by-side configuration.  This creates a dead space below the toolbars where screen real estate is wasted. Not a big deal just unprofessional.
    3.     General image display quality is horrible!  I have set View>Display Performance>High Quality Display and it does not matter if I embed or link images; does not matter if I use jpg, gif or png. The presentation is always ugly.  The gif looks a little better than the others when viewing the document with indesign, however, an exported pdf has degraded quality with gif. 
    4.     Performance.  I am running on two rather beefy machines, details below, and with twenty page documents indesign is sluggish and unresponsive at times.  This is not associated to embeded images as it occurs with or wtihout attached images.  I am fearful of putting indesign to task with larger projects.
    5.     Selection methods are downright cumbersome.  I have taken the time to learn some of the subtitles with the selection tools. For a rudimentary function this completely fails the intuitive test. I am not an indesign expert, but I shouldn't have to be either.  Since software is my business I tend to pick it up quickly and I think I know my way around indesign pretty well; I find the selection tools to be awkward at best.     
    I use two computers regularly and experience all the mentioned issues on both computers. 
    #1 Lenovo laptop T60p, 15" 1680x1050 ATI Mobility FireGL V5250 256Mb, 2.7mhz, 3Gb RAM.  I often connect this to a 21" 1600x1200 Viewsonic monitor.
    #2 HP Workstation 22" CRT 1920x1080 running an nVidia card 256Mb, 3mhz 4Gb RAM. 
    On the positive side I am impressed with the auto alignment features in CS4.  (if these existed in CS3 I didn't encounter them in the short time I used CS3.)  However, there are numerous basic features that are sorely lacking attention that in my opinion should have been addressed first.  I would ask the indesign product managers to consider shoring up the rudimentary features of indesign before adding new features.

  • Centering Label Text over front Panel Indicator

    How can I get the Text in the Label of a Front Panel LED Indicator Control in LabVIEW 2009 to be centered over the LED?
    How can I change the Font an Font Size of the Text of a Label?

    Hi,
    Label to be center at the object.
    There are many Ways like
    1) what the JackDunaway has explained  Text Settings Toolbar button.
    2) Other you can dynamically change the property of label.
    Like you can change programmically change label justification, size, color, and many property.
    Just right click on object.Go to creat property node. refer screen shot for more help.
    Thank you.
    CLAD
    Labiew programmer
    Attachments:
    Lebel property.png ‏133 KB
    Lebel property.png ‏133 KB
    Lebel property.png ‏133 KB

  • Add rules under menu text in accordian panel?

    Hi,
    The client requested rules under the text, to go the entire width of the accordian panel. I can't figure out how to do this.
    For example, I need to add a dividing rule probably in a lighter tan/gold color the entire width of the accordian panel, between HOME and HOW IT WORKS:

    Select one submenu entry (in the top left of the Muse window "menu item" has to be indicated.
    Set "stroke" to "0". Then click onto the orange word "stroke". Here you can adjust all edges separately.

  • Cursor automatically jumps to end to text when clicking inside and online form

    When I type text in an online form like the one I am using to post this question and I want to go back and edit my text I click on the text/line I want to edit in the online form  but my cursor automatically jumps to the very end of the text. 
    Is there a setting I can change to stop this from happening?
    Thanks.

    the best way to test is to remove OnKeyUp="this.value=this.value.toUpperCase();"  and then check whether you still have the problem
    strange that the problem is there even when you replace OnKeyUp with onChange because the function should not be executed until the change is complete. also replace OnKeyUp with onBlur
    share the results

  • Jump within a BIG text file

    Hi,
    I have a text file with more than 3 million lines.
    How can I easily jump to a specific line without reading line by line.
    e.g. using the class RandomAccessFile to jump you need the number of bytes.
    But each line has diffrent numbers of characters, thats why I can't jump directly via "seek" method.
    thanks
    Aykut

    aykut_arslan wrote:
    @paul.miner
    can you write a little code, his suggestion of reading the file is not clear for meNo, that's for you to do. If you can at least write a good start, you can get help here, but I'm not going to write it for you.
    I will give you some pointers:
    1. Use RandomAccessFile.
    2. The position you seek() to in the file should be directly proportional to the position of the scrollbar (e.g., if scroll bar is at 42% of it's maximum, seek() to 42% of the file size).
    3. After seeking, read forward until you encounter a line break. Start displaying text from that position.
    EDIT: Or just go with indexing, which is far simpler. As BDLH suggested, background processing is a good option. You could also make it so that the scroll bar position is proportional to the number of lines read so far, not the size of the file.
    Edited by: paul.miner on Jan 16, 2008 2:29 PM

  • How to import yellowed market text passages from word to indesign????

    Dear friends,
    in my word - very long draft for a PhD-Dissertation, I have marked everything yellow that is not finished yet. Now I changed from word 2007 to indesign (CS 5  - mac) as I had some problems with word. My question is how I can import my  yellow marked passages into indesign.The Importation of documents is not a problem,my only problem is, that the color is gone then. It would be a huge work to color the passages again individually,. THANK YOU for your  help.
    Best Jörg

    Those colored backgrounds don't translate into anything in InDesign -- the function simply does not exist.
    Use Find & Replace to replace it with something else in Word that *does* import (colored text or something), then change it again in InDesign to a custom underline.

Maybe you are looking for