3 Questions- Two about text boxes and one about something else! (10 Points)

Hi, I'm doing a large project in java and have ran into several issues. These are summed up in these three questions:
1. How would I make certain words certain colours/formats? I have been told I should a JTextPane, but all my text is currently in a box created like this:
static JTextComponent textbox = new JTextArea("", 23, 60);
2. How would I give that above box (or the JTextPane if I used that) line numbers next to each line. Not part of the text box, but on the left hand side numbers go down every line, however (and here's the catch) when you scroll the text box, the line numbers have to scroll also, so they stay in touch with the lines.
3. How would I launch an external application? At the start its just an .exe, however I have to load it with certain parameters? any ideas?
Thank you
Alex

1. How would I make certain words certain
colours/formats? I have been told I should a
JTextPane, but all my text is currently in a box
created like this:Then you have a problem. You need something that can handle a StyledDocument
2. How would I give that above box (or the JTextPane
if I used that) line numbers next to each line. Not
part of the text box, but on the left hand side
numbers go down every line, however (and here's the
catch) when you scroll the text box, the line numbers
have to scroll also, so they stay in touch with the
lines.http://www.developer.com/java/other/article.php/3318421
3. How would I launch an external application? At the
start its just an .exe, however I have to load it
with certain parameters? any ideas?http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Similar Messages

  • Two different text boxes?

    Hi,
    I just opened a template that comes with Pages. There are two different text boxes. One has the usual little white squares at the edges. The other one has yellow dots instead. What is the difference between them? Does anyone know?
    Thanks
    P.

    Hi, it's Pages 5.2.2 and the template is DIN5008-A and DIN5008-B which are specific to Germany, I think. Please see the screenshot. I haven't seen it in any other document yet.

  • How to link one scroll bar with two dynamic text boxes.

    How to link one scroll bar with two dynamic text boxes.
    If i move scroll bar in one text box,automatically text will
    be moved in another text box.But scroll bar is not visible.
    Can you please help me.
    Thanks in advance.

    See the following article:
    JavaScript - setFocus Method for tabbing to next form field
    And see if iOS can even handle the sample form.
    iOS and android devices are not a powerful as your desktop of laptop computer and have limited support for JavaScript within PDF forms. This limitation for specific apps ranges from none to quite a bit but not all JavaScript.

  • Help on resizing text boxes and general image techniques

    Using CS2.
    I have two basic questions.  One has to do with getting the best vector images (with text) that I can for placement in InDesign documents.  The other has to do with the specifics of working with text boxes in FW.
    The easiest way for me to produce vector images has been by using PowerPoint.  I do all the graphics work and then save it as a gif.  I do cropping in a graphics tool (Irfanview, PS) and then insert or place the image.  As long as there is no resizing, things work well.  I'm not sure how things like DPI are controlled using this technique but I'm assuming that also would be done with the graphics tool.  I know Irfanview allows for the dpi to be specified during resizing.
    The problem starts to show up when the gif object is resized.  Things get distorted and I lose the crispness of the image contents.  I'm certainly not an expert on graphics however I've been thinking I either need to 1) make the actual size of graphics in PP the size of the final placed image so there is no resizing (just some cropping) or 2) to work in a tool like FW where (I'm assuming) there are better capabilities to resize vector graphics.  My sense (again, not an expert) is that the process I'm using converts to vector graphics in PP to a bitmap image in the gif and that resizing doesn't work as well for bitmaps as for vector objects.  Do I have that right?
    Moving on to question 2:
    Can text boxes be resized in FW without distorting the text?  Can their size be seen when originally drasing them?  Perhaps spoiled by PowerPoint, I like to set the width of vector objects (e.g. rectangle) and the width of the text that will fill it to the same size.  (I know PP has the ability to put borders on text boxes but when working in FW I need to work with 2 objects, the rectangle and the text box).  Say I have a rectangle that is 81px wide.  Can I set a text box to 81px wide without distorting the text?
    I tend to want to control actual object sizes so I can get good spacial alignment.  For example, I tend to set the width of a text object to an odd number of px so that any line coming out of the text object aligns well with the text.  I must admit that it may be time for me to use a different technique in FW (e.g. more alignment of multiple objects vs. knowing dimensions and seting locations).  Does my approach need improvement?
    Thanks for any advice
    Tom

    As I wean off of PP I've started looking at FW and Illustrator (I have both).  I've done a logo or two in FW and have used it to build some simple web graphics (e.g. buttons, menus).  It can, as I recall, be a little more complex than what I need in this case.
    Since PP is not a graphics program, its drawing capabilities are very limited. As a consequence, any graphics application will have many more features than you're used to seeing and more than you need for any one project.
    I did a little experimenting with Illustrator and my first impression is that it will work better for me for this work.  It seems a little more intuitive.
    Is a general guideline to use FW for web-destined graphics and Illustrator for what I used to do in PP?
    Your suggested guideline is good. Also, note that if you make a logo or vector graphic in Illustrator (saving as .ai format), you can import that into Fireworks and work with it as a vector object there. FW can import and use, just not create, .ai objectes and files.
    FW has some vector tools, they are tucked away under Window > Others > Path. Since FW is intended for producing Web graphics, it is a hybrid application, capable of both vector and photo/image editing. Given that it has some of both, it necessarily doesn't have everything that Illustrator has nor everything that Photoshop has. It has most the features of both of those programs, as long as the feature is useful for a Web graphics designer. For pure photo editing Photoshop has the edge; for pure illustration, Illustrator has the edge. Both Photoshop and Illustrator support color profiles and other features important for print that Fireworks does not. All are good programs, but there are reasons to prefer one over the other depending on what kind of graphics you need to create or work with and what your intended use of the work is. (But any of them will be superior to PowerPoint! )
    I'm not sure I can unravel the mystery with the text box resizing.  I suspect theres an option selected.  Knowing it can be done is enough for me to do some homework.
    Maybe...don't think of text boxes at all. You have text objects. The object has a bounding box that is determined by the underlying definition of the font, but it isn't in a text box. (Sometimes swooshs will extend beyond the defining box of a character in the font, but that is another issue). The bounding box for the text object is similar to the bounding box of a circle or a star or an irregular shape. There's a reference box for the dimensions, but the text is not inside some other independent container.
    To resize, select the text object and change the font size either using the Properties palette or using the scale tool to drag on a corner of the scaling outline (different from the bounding box, and I don't know why, sorry).
    I think that,with Illustrator, you can define text boxes (or other shapes) and fill them with text. *searches* Ah.. Like these: http://school.tatoland.com/illustrator/aitype.html
    cheers!
    Lorraine

  • Two column text box with header

    I have a text box that is set to flow as two columns. The beginning of the text box has a header then a list of bulleted items. My problem is that when the text flows to the second column, it is set at the top (in-line with the header). What I would like is to do something like set a top margin just for the second column so it will line up with the body text from the first column. Is there an easy way to do this or should I just use two text boxes and position the second box where I want it?

    Simplest is to use two text boxes.
    Dave Saunders has a script (http://pdsassoc.com/index.php?Nav=downs&Ban=Downloads&Info=downloads.html) that can do it with one text box by putting your head in a one-column table that intrudes into the second column. I've never used his script, and I see his website says CS and CS2, so I'm not sure if it would work with your version.
    You could probably achieve what you want (because I see you don't actually need the head to straddle, just the texts to top align with each other) by forcing a huge leading on one character in a frame that's set to First Baseline Offset by Leading.
    Ken

  • Problem with action script 3 make input text box and button....

    Hi every one I am trying to make a family book using "Air for Android" with a simple search engin in the book
    air for android only work with AS3,
    the search function is to type a person's name and hit submit then go to a specific frame.
    have a problem making below code to work in AS3 and hopefully one of you guys can lead me in the right direction to fix the issue.
    Currently, I have an input text box and a button. When you type specific words into the input box and then hit the button it sends you to a specific frame.
    (it work find in AS2 but not in AS3,)
    Here is my current code that is placed on the main timeline, first frame:
    stop();
    onEnterFrame = function () {
        submit.onRelease = function() {
            switch (yourname.text) {
            case "name1" :
                gotoAndStop(2);
                break;
            case "name2" :
                gotoAndStop(3);
                break;
    My button that checks if the phrase is correct is called "submit" and my input box has an instance of "yourname".
    My phrases that will be accepted in the input box are "name1" and "name2" which bring me to two different frames.
    Basically, I'm having a problem with making this to work with AS3.

    you should use the default option in the switch statement
    that way yourname contains something not in one of the case statements it will go to the default bit and execute teh code there
    function onSubmit(e:MouseEvent):void
                                  switch (yourname.text)
                                            case "name1":
                                                      gotoAndStop(2);
                                                      break;
                                            case "name2":
                                                      gotoAndStop(3);
                                                      break;
                                            default:
                                                      goToAndStop(you frame you want);
                                            break;

  • Text Boxes and Lines on Full Screen Images?

    In iBooks Author I'm trying to create images with text boxes and lines overlayed on top of the images (I don't like the interactive image widget, I want just text with no gray box and a single line of text, no need for title and description, also don't need the zoom capability on each label).  I can do this fine in a basic, two column layout but when I tap on an image within a figure to see it full screen on the iPad I want the text and lines to also come full screen.  Any ideas?  I seemed to have a solution by enabling placeholder text authoring but that's proven inconsistent.

    Sound like a 'group'.
    Whatever works
    Good luck
    Ken

  • Converting images that include text boxes and callouts in FM

    Hello,
    I'm on a new project (TCS 3.5, RH 9, FM 10) that requires me to include text boxes and lines (callouts) on top / in front of many of the images in FM. The reason they are not allowing me to add the text/callouts to the images themselves is because they want to keep the text boxes editable for translation.
    The problem: After importing into RH, these images have white borders on all sides that they didn't have previously and I can't figure out what's causing it.
    When I remove the text/callouts from over the images in question, then reimport, the problem resolves and the white borders disappear. When I view the original image files, there are no borders present. After I import, I view the image file in the RH folder and it does include the border. (So the border is on the image itself.)
    Presently, the Object Properties for the images are as follows:
    Offset From:
    Top: 0.0"
    Left: 0.0"
    Border Width: 0.015 (which is lowest FM allows me to set... I get an error message when I try to enter 0.0)
    Anchored Frame settings:
    Anchoring Position: Below Current Line
    Alignment: Left
    Cropped/Floating: both unchecked
    I've tried many different variations and tests; probably too many to list here. In short, the "border" appears when there is text/callouts on the image and it disappears when I delete the text/callouts. I was hoping that someone may have had a similar issue. Please let me know if you need more info to troubleshoot and thanks for reading.
    Best,
    Tom

    I had the same problem with callouts, but my solution was to add them directly to the image, so that doesn't help you.
    Another things you can try to is ensure that the edges of the image do not touch the edges of the anchored frame. Make sure there is a bit of white space. I don't know why, but when any of my images touch the anchored frame, the conversion looks awful.
    Also, my images appeared best in Robohelp when I set the properties for the image in Robohelp as follows:
    File > Project Settings
    Import tab
    Edit conversion settings for FrameMaker documents
    On the left side, select Image
    Set Width and Height to 0pt (this ensures that the image is not resized)

  • How to get the text boxes and select lists dynamically?

    Hi,
    I have a requirement such that I need to create the text boxes and select lists depending on the user input at the run time. It means that if the user requires four text boxes/select lists then I need to have 4 such thing. If the user need 6 then I need to have 6.
    The design may be such that initially only one text box/select list will be available when the page launches. Then as ad when the user asks for more those will be available to the user accordingly.
    regards,
    Dipankar.

    You can use Ajax to call textboxes and select list based on what user enters.
    Otherwise make those items conditional and based on what user enters you can display textbox or select list.
    You can call Single Textbox and Select List using Ajax for any number of conditions.
    Regards
    Chandra

  • Is there a way to copy text boxes from one pdf file to a different one?

    is there a way to copy text boxes from one pdf file to a different one in Acrobat 11?

    Yes. In Form Edit mode select the field(s), press Ctrl+C and then move to
    the other file and press Ctrl+V.

  • Threading two different text boxes

    Hi.. How do you thread two different text box with two different text format?
    Eg. Text Box 1: Font Size 50pt...
    Text box 2: Font Size 10pt..
    Once you thread the two text boxes; and delete the content in Text box 1, what ever the content that flows to Text box 1 from text box 2 should auto format to Font Size 50.
    Any Idea how to do this?

    If I understand you corrrectly, I don't know how to do that, but in case I don't understand what you want, can you please tell me if I have this right?
    You have a chain of text frames. When you start entering text, it is 50pt. When the text fills the frame and jumps to the next frame, all of that text is 10pt. and this is all done automatically. In other words, the first word of the second frame would change from 10 to 50 automatically if it jumped back to the first frame for some reason (like the first frame being made larger, or some of it's text being deleted).
    If that's what you want, then maybe someone else knows how to do it, but I don't.

  • Connect two floating text boxes in Pages so the text continues

    Hi,
    I'd like to connect two floating text boxes in Pages 5.0 so text continues beetween them. I'm sure that in Pages '08 this function was implemented, is there some way to do this on the new version? Thanks!!

    No, feature removed allong with over 90 others:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&mforum=iworktipsn trick
    Pages '08 or Pages '09 should still be in your Applications/iWork folder.
    Trash/archive Pages 5 and rate & review it in the App Store.
    Peter

  • I have two apple id's and one I cannot remember the password so I made a new one but to update my apps it still asks for the old password... How do I update my apps?

    I have two apple id's and one I cannot remember the password so I made a new one but to update my apps it still asks for the old password... How do I update my apps?

    All content and data is forever associated with the Apple ID you used to download it. You should have reset the password for the original I'd.
    I forgot.apple.com

  • I have three Safari icons. Two in the dock and one on the desktop. How do I eliminate them?

    I have three Safari icons. Two in the dock and one on the desktop. How do I eliminate them?
    One from the dock and the one on the desktop.

    nezzer wrote:
    the desktop item will not delete or "move to trash"
    In Finder, select the item. Choose File > Get Info (or do ⌘I). Look under General > Kind. Does it read "Alias" or does it read "Application (Intel)"?
    If the latter, then it is likely that you're not allowed to delete because it's actually open. Quit Safari. Check if there is an item called Safari in your </Applications> folder. (In Finder, you can get directly to the Applications folder using ⇧⌘A -- that's Shift-Command-A.) Check if it's an application. If it is, then you have an unneeded copy of Safari. You can delete the one on your Desktop. If there isn't, them move the one on the Desktop to the Applications folder -- that's where it belongs.
    If you're new to the Mac, consult
    Mac 101
    <http://www.apple.com/support/mac101/>
    If you're coming in from the Dark Side, consult
    Switch 101: On Windows, I used to...
    <http://support.apple.com/kb/HT2514>

  • I created a 5x7 postcard document in Word with text boxes and graphics.  When I converted it to PDF, some of the items were missing, even though they were in the boundaries of the page and looked fine on the Word document.  What happened, and how do I fix

    I created a 5x7 postcard document in Word with text boxes and graphics.  When I converted it to PDF, some of the items were missing, even though they were in the boundaries of the page and looked fine on the Word document.  What happened, and how do I fix it?  I'm trying to upload the PDF version to Vistaprint.  Thanks.

    Reader doesn’t create pdf files. You can use Acrobat (ask in that forum) to create pdfs. You can subscribe to the Adobe PDF Pack which has a create pdf functionality (please ask in that forum), or you can use a third party utility such as ghostscript, cutepdf, or Microsoft’s own PDF creation capability. For third party pdf creation you will need to ask in a forum dedicated to that software as fellow users of Reader are unlikely to have the knowledge to help.

Maybe you are looking for

  • HELP!!!! i duplicated all of my albums in iTunes by importing it twice.

    Is there a free app that will clean up all of my duplicated songs in iTunes? I was trying to put just the new music files from windows media player and imported the whole library again by accident. Yikes!!! Still dont know how to do just new files bu

  • BW-Lumira by using universe

    Hello All, I'm trying to use Lumira to explore data in BW infocube. To do this, I've created a relational connection and built and universe. When I select a very few characterists (key and/or text) and ratio, it's work. But as the number of objects (

  • Can't sync an ipod classic

    I was given an Ipod classic by a friend and I can not get it to sync with my computer

  • RoboHelp 9 - What does WebHelp Search actually Search

    I am using RoboHelp 9 and can't seem to find out what WebHelp Search actually searches. Will it search Word documents, PowerPoint or PDF documents that are included in the Project files? Or does it only search for the keywords that I enter for that t

  • FUNCTIONAL MODULES IN Q.M

    Hi Gurus, What are functional modules in SAP Q.M. How are they used.where do i get some detail info about functional modules in Q.M or in general Regards Ram