Adding text to a rectangle

hi, i am making a hierachical tree . i think the best way to do this is via rectangles and lines using java 2d. i was just wondering if there was any way of adding text to a rectangle apart from the drawstring method from the 2d api. or does anyone know of any other way to do this? the tree needs to be interactive so i cant use jlabels and jbuttons are quite ugly
thanks for any help

yeah, thanks, it did help. it's just i'm new to layout algorithms and there was a couple of things i wasn't too sure on.
i have used defaultmutabletreenodes instead of creating my own class as you did but i don't think that matters too much. i wasn't too sure about how you worked out the spacing for each node. i have done a breadth first traversal through all the nodes so i would know how many nodes are on each level and could work out the spacing needed for each level based on this i.e. look at the next level and place the current level in proportion. did you do something similar in the treelayout class?
would this approach work even if the amount of nodes is large, could the container containing the tree be in a scrollpane?
the problem i found with drawstring is that you need to provide coordinates for where to draw the text instead of just adding it to the rectangle (like you could in a jlabel) so it could look untidy. could you make a jlabel interactive or add text to a rectangle?
sorry my reply is so long but any help would be much appreciated

Similar Messages

  • Photoshop CC : Workspace Flashing Black When Inserting Guides & Completely Black When Adding Text

    I recently bought Photoshop CC (2 Days Ago) and shortly after installing I jumped onto Photoshop CC and started to set up the prefferences for my personal use and started to just do some basic stuff and see whats new in CC. when inserting Guides & adding Text the workspace started to flash/stay BLACK. I don't know whats going on but my specs are better than the minimum requirements? Any idea whats going on? Operating System : Windows 8.1

    Have a look through this step by step guide.
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
    It's coming up 1am here, so I am calling it a night.

  • I saved a PDF doc in adobe and then added text to the form. But every time I try an email it it only

    I saved a PDF doc in adobe and then added text to the form. But every time I try an email it it only sends the original form without text. Once I've changed a doc in Adobe, how can I save it so that I'm able to use it with added text and notes? Also, I'm using a new iPad.

    If you are using those apps or websites, they are likely viewing the PDF using iOS' built in PDF previewing, which will not show annotations and markup to the PDF. We have informed Apple of this issue, but do not have any insight into whether or when they will fix it.
    Regarding the qustion about importing pictures, Adobe Reader does not provide any capabilities to import pictures into a PDF. To do this, you'll need to use Acrobat, available on your desktop computer.

  • Can't figure out how to enclose text in a rectangle, as I used to do in Word... any ideas?!

    Can't figure out how to enclose text in a rectangle, as I used to do in Word... any ideas?!
    thanks!
    Gary Eskow

    Pages doesn't let you separately set border offsets, Indesign is the only application I know that can do that.
    You can get the effect with margin insets inside a Text box or offsets inside a Border.
    Inside both the Textbox and Border move the margins of the Text inside to have the Text where you want it relative to the border/stroke.
    When looking for a solution there is usually more than one way to look at the problem itself.
    Peter

  • How can I remove the underline from added text for tracing edits

    We have a lot of content that includes underscores and when we use the track text edit feature added text is green and underlined. How can I change the properties of the added text to not be underlined?

    Starting with FM11, you could specify a custom colour to be used for track changes, but the styles (underline, strikethrough) are still hardwired.
    Even if you try to make the changes to the rack text edit conditions in a MIF file, they will get overwritten as the MIF is interpreted when opened by FM.
    Please use the new Bugs & Features form to submit an enhancement request: https://bugbase.adobe.com/index.cfm

  • Photoshop CS4 freezes when adding text to box.

    Typing text into a rectangle box freezes Photoshop with the unclose-able error box "Could not complete your request because of a program error"
    Force quit and clean-start with command-option-shift Start Photoshop and still same error. I can type text into the box for about 10-20 characters and then error box again.
    Using PS CS4 v11.0 with OS 10.5.6 with G5 Dual 2 Ghz PowerPC accessing files on external firewire drive.
    Any suggestions?

    Right you are.
    Corrupted font cache(s).
    Cleaned out and dumped all caches with Cocktail and restarted clean. A-OK now.
    Thank you.

  • Adding Text to a photo...Need help

    I'm new to Adobe Photoshop Elements 7. I'm following the instructions for adding text to a photo, but I can't see what I'm typing. I can see the cursur, but nothing else. I can see the text in the Layer, but not on the photo. Please help.

    Check the font size in the options bar. If it's really small you won't see it.
    Look in your layer's palette and insure your text is in a layer located above the photo in the stack.
    You might also check your image's resolution in the Image Size dialog. I've seen a couple of posts where someone changes the resolution to 1 with resample turned off...then can't see the text because it's too small even when they have large numbers inserted in the font size box.

  • Acrobat crashes whenever adding text

    This occurs whether there is a text box to be filled in or using the add text function. There may be other things also crashing it but this is the biggest issue for me on my Mac host system. If I open the same documents in a Windows VM using Reader, I can enter text without difficulty.
    Mac 10.8.4
    Acrobat XI Version 11.0.03
    Here's some of the error message displayed:
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Application Specific Information:
    abort() called
    terminate called throwing an exception
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   libsystem_kernel.dylib                  0x929d3a6a __pthread_kill + 10
    1   libsystem_c.dylib                       0x96905b2f pthread_kill + 101
    2   libsystem_c.dylib                       0x9693c4ec abort + 168
    3   libc++abi.dylib                         0x94e1a7e0 abort_message + 151
    4   libc++abi.dylib                         0x94e18249 default_terminate() + 34
    5   libc++abi.dylib                         0x94e18289 safe_handler_caller(void (*)()) + 13
    6   libc++abi.dylib                         0x94e182f1 std::terminate() + 23
    7   libc++abi.dylib                         0x94e193e6 __cxa_throw + 110
    8   com.adobe.linguistic.LinguisticManager          0x14054a46 0x1404e000 + 27206
    9   com.adobe.linguistic.LinguisticManager          0x1405dabb devtech::LM_FileSpec::LM_FileSpec(FSRef const&) + 43
    10  com.adobe.AcrobatPlugin.Spelling          0x1340b733 0x133d0000 + 243507
    11  com.adobe.AcrobatPlugin.Spelling          0x1340b05e 0x133d0000 + 241758
    12  com.adobe.AcrobatPlugin.Spelling          0x1340affb 0x133d0000 + 241659
    13  com.adobe.AcrobatPlugin.Spelling          0x13400acb 0x133d0000 + 199371
    14  com.adobe.Acrobat.framework             0x00286b29 0xda000 + 1755945
    15  com.adobe.Acrobat.framework             0x0028666a 0xda000 + 1754730
    16  com.apple.CoreFoundation                0x9743c406 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
    17  com.apple.CoreFoundation                0x9743bda5 __CFRunLoopDoTimer + 709
    18  com.apple.CoreFoundation                0x97420bb2 __CFRunLoopRun + 1842
    19  com.apple.CoreFoundation                0x9742001a CFRunLoopRunSpecific + 378
    20  com.apple.CoreFoundation                0x9741fe8b CFRunLoopRunInMode + 123
    21  com.apple.HIToolbox                     0x9017ff5a RunCurrentEventLoopInMode + 242
    22  com.apple.HIToolbox                     0x9017fbf5 ReceiveNextEventCommon + 162
    23  com.apple.HIToolbox                     0x9017fb44 BlockUntilNextEventMatchingListInMode + 88
    24  com.apple.AppKit                        0x9070f93a _DPSNextEvent + 724
    25  com.apple.AppKit                        0x9070f16c -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 119
    26  com.apple.AppKit                        0x907055cc -[NSApplication run] + 855
    27  com.adobe.Acrobat.framework             0x000e38b0 0xda000 + 39088
    28  com.adobe.Acrobat.framework             0x000e1ff3 RunAcrobat + 307
    29  com.adobe.Acrobat.Pro                   0x000d3ed5 main + 91
    30  com.adobe.Acrobat.Pro                   0x000d3e71 start + 53

    I'm having a similar issue. Every third or fourth time I save after adding text Acrobat crashes with no meaningful reason (at least none in the crash message)...even though the added text is saved. I'm working through trying different text settings to see if there is a problem there. I'll post what I find.

  • Unable to print added text only in Acrobat Pro XI

    User is trying to print added text that's been added to an existing PDF page.  In Acrobat X she chose "Form fields only" under Comments & Forms from the Print menu.  In XI it produces a blank page.  The added text only shows up if she chooses Document or Document and Markups, but then she gets the entire document.  She only wants the added text to print.

    Thanks to all who commented here.  I found that adding text using Tools>Content Editing>Add Text will not allow the user to print solely the added text.  As everyone responded here, that's as designed.  However, using Comment>Annotations>Add Text does allow the user to print solely the added text as she was used to doing in Acrobat X.  I thought it was the same tool under two different headings, but obviously they interact differently in the print menu.  Choosing Form fields only from the Print Menu's Comments & Forms panel will produce solely the text added under the Comment panel's Add Text tool without printing the rest of the document page.  And the user doesn't have to turn the document into a form to do so.

  • Why does Preview automatically resize the text box to cut off the last character of added text? How do I fix it?

    Why does Preview automatically resize the text box to cut off the last character of added text? How do I fix it?
    I use the Tools > Annotate > Add Text feature, and when I click away after adding text, it automatically changes the text box size such that the last letter -- or last word -- gets bumped off into an invisible line below it, forcing me to manually adjust every single text box. It is highly annoying when trying to complete PDF forms (e.g. job applications).
    It appears to be a glitch, quite honestly, an error resulting from Apple's product design. Has it been fixed in the new operating system (for which they want $30)?
    I would very much appreciate any help you can provide! Thank you for your time.

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • Why does added text disappear when I move the cursor

    After adding text to an unprotected .pdf file the text disappears when I move the cursor and want to add a second box of text. The text in the first box reappears when I double click on the space where the box was. How do I set the text so that it remains visible and printable?

    Hi,
    I think the data in the PDF file was filled-in using MAC preview.
    One option is to ask the user to fill the file again using Adobe Reader or Acrobat.
    Or else refer to following link:
    http://acrobatusers.com/actions-exchange/pdf2fdf_auto-save
    Regards,
    Anoop

  • Adding text to a photograph

    Hi,
    My question is in 2 parts really:
    1) Once the photos are uploaded into iphoto, is there anyway of adding text to the photo?  Say a title, or details of something about the picture that I wouldn't want to forget?  If so, how can I do this?
    2)My camera has the ability to add text to pictures.  If I did this, when I came to uploading them into iphoto, would the text come with the pictures, and if so, where would it be displayed?
    3)When exporting the photographs, to share with others or print, would I be able to disable the text, so it doesn't show on the photograph?
    Thanks very much.

    in iPhoto there are several ways to add information about a photo - a title - a decscription - keywords - putting it in an album = these are all metadata and local to your computer - you can choose to include or not include them when you export a photo
    if you want to actually put text on a photo then you must use a thir party program (Preview can do this - Annotate) or external editor - one you add text to a photo it is there and the old information behind the text is gone
    as to what you camera does - read the camera manual - if it puts text in the EXIF ro IPTC fields and if iPhoto reads thos fields then that information will be part of the iPhoto database - it it puts text directly on a photo then it is part of the photo
    LN

  • Adding text to a photo in iphoto

    How do you add text to a smart album photo?  Also, when syncing to my iphone, I want the text to appear.  I am building a tropical plant field guide.

    iPhoto has no capability of adding text onto an image.  For that you'll need a 3rd party image editor setup as the  external editor in iPhoto.
    Some Image Editors that support  layers:
    Photoshop Elements 11 for Mac - $79
    Rainbow Painter - $30
    Imagerie - $38
    Acorn - $50
    Pixelmator - $60 
    Seashore - Free
    Portraits and Prints - Free
    GIMP for Mac - Free
    OT

  • In "Previews" when adding text to a picture I can't change the font, even though a few days ago I could.  How do I fix this?

    In "Previews" when adding text to a picture I can't change the font, even though a few days ago I could.  How do I fix this?

    kgwrotethis wrote:
    10.6
    Use Software Update to update your os to 10.6.8 and anything else that needs to be updated.  After the installations go to /Library/Preferences - trash the com.apple.Preview.plist file.  Repair permissions, restart your computer and empty the trash.  Your Preview issue should now be resolved.

  • Added text & signatures do not print correctly

    I am using Acrobat Reader v10.4.4 on my iPad Mini with IOS 6.1.2 and am having issues printing. I can open any PDF and have it displayed correctly. I can add text and signatures and the document is saved correctly because it can be opened after the changes are made and they are still there. When I try to print the document where I have added text and signatures to, the document does not print correctly. All of the text and the signature are shrunk to a very small size and appear in the lower left hand of the page.
    I depend on my apps to work they way they should and having this issue makes my work very hard. I have to be very creative and perform unnecessary steps to get my PDF's to print the way they should. Does anyone have some insight in to this bug?

    Hi,
    Thanks for reporting this issue. We would like to investigate this issue at our end and if you could share one such pdf file in which you are facing the issue at [email protected], that would greatly help us.
    Thanks,
    Ankit

Maybe you are looking for