Aligning text and images in a StyledDocument like 'middle' on img in HTML

Hi,
I have a StyledDocument which is a document source for a JTextArea, into which I am inserting combinations of 22x22 images and text strings. This is just a nitpick, and I am hoping someone could assist.
What I would like to do is middle-align the text and images, so that the strings are vertically centered with the images.
You can reproduce this as such:
messagePane = new JTextPane();
messagePane.setMargin( Constants.smallInset );
doc               = (StyledDocument)messagePane.getDocument();
Style style;
style = doc.addStyle( "normal", null );
StyleConstants.setForeground( style, Color.BLACK );
StyleConstants.setFontFamily( style, "Verdana" );
StyleConstants.setFontSize( style, 12 );
style = doc.addStyle( "image", null );
StyleConstants.setIcon( style, new ImageIcon( someimageofyourchoice )  );
doc.insertString( doc.getLength(), " ", doc.getStyle( "image" ) );
doc.insertString( doc.getLength(), "some misaligned text", doc.getStyle( "normal" ) );Thanks in advance!
Alex

code correction:
top block:
messagePane = new JTextPane();
messagePane.setMargin( Constants.smallInset );
StyledDocument doc = (StyledDocument)messagePane.getDocument();cut + paste from several separate components...

Similar Messages

  • The latest Firefox version won't expand to make text and images more visible on my 32" screen, although I have tried to adjust the advanced Windows appearance settings in the same way that has worked in previous versions of Firefox.

    Normally I have had to go to Control Panel; Appearances and Themes; Display; Settings; Advanced; Custom; and then I adjust the Customize Setting to 155% (149 dpi). I have hit on this setting through trial and error; larger and icons like the cursor get big and fuzzy. Smaller than 155% and text and images are tiny on the 32" wide screen. This time that procedure doesn't seem to work. The text and images remain too small regardless of setting, although the cursor icon gets big. I can manually zoom the pages, but that is clumsy and has to be redone. Does anyone know of an easy setting fix? I am not too smart about this stuff--mostly trial and error, but I do want to be able to enjoy my wide screen. Thanks!

    Normally I have had to go to Control Panel; Appearances and Themes; Display; Settings; Advanced; Custom; and then I adjust the Customize Setting to 155% (149 dpi). I have hit on this setting through trial and error; larger and icons like the cursor get big and fuzzy. Smaller than 155% and text and images are tiny on the 32" wide screen. This time that procedure doesn't seem to work. The text and images remain too small regardless of setting, although the cursor icon gets big. I can manually zoom the pages, but that is clumsy and has to be redone. Does anyone know of an easy setting fix? I am not too smart about this stuff--mostly trial and error, but I do want to be able to enjoy my wide screen. Thanks!

  • Stretched text and image with FULL_SCREEN_INTERACTIVE after Air player update

    One of my Air applications uses StageDisplayState.FULL_SCREEN_INTERACTIVE to switch to full screen during the presentation of some sheets.
    Everything worked fine untill some users reported a streching of texts and images in the sheets.
    It turns out that the problem occurs after an update from the Adobe Air Player to 3.1 from  2.7.
    The first screen shots shows the text as it should be, the second screen shot shows the text after the update of the Air Player.
    The code used to go into the Full Screen mode is:
        public function setFullScreenInteractive(fullScreenWidth:int = Constants.INT_SCREEN_WIDTH_SMALL, fullScreenHeight:int = Constants.INT_SCREEN_HEIGHT_SMALL):void
                             s.fullScreenSourceRect = new Rectangle(          0, 0, fullScreenWidth, fullScreenHeight);
            s.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    with  Constants.INT_SCREEN_WIDTH_SMALL = 800 and  Constants.INT_SCREEN_HEIGHT_SMALL = 600.
    I can reproduce the problem on a couple of computers with Windows Xp but it's not happening on all the computers I've tested.
    Any idea how to fix this (without telling my users to Uninstall the current Air Player and reinstall the Air Player 2.7)?
    Regards,
    Bart

    Hi Bart,
    Unfortunately the correct screenshot link appears to broken.  Could you please open a new bug report on this over at bugbase.adobe.com?  Please post back with the URL so that others affected can add their comments and votes.  It would also help if we had a sample project/application that we can reproduce this issue with.  If you'd like to keep this private, please feel free to send it to me directly at [email protected]
    Thanks,
    Chris

  • Is the BSP extension better than this solution(Text and Image in Button)?

    Hi guys,
    I have a  concept question to decide whether a BSP extension is needed.
    I want to put text and image in htmlb button, and used the solution like below:
    <%
      data image type ref to cl_htmlb_image.
      data: image_string type string.
      create object image.
      image->id = 'back'.
      image->src = cl_bsp_mimes=>sap_icon( id = '@9S@' ).
      image->tooltip = 'Go back'.
      clear image_string.
      image_string = image->IF_BSP_BEE~RENDER_TO_STRING( page_context ).
            %>
            <xhtmlb:toolbarButton id      = "back"
                                  onClick = "back"
                                  text    = "<%= image_string %>" />
    But this solution is not desired by customer, since they don't think it looks nice. So is it possible to create my own BSP extension to get a nicer element?
    Thanks for any hint.
    Regards,
    Liying

    Hi,
    By a nicer element...did you mean to display a better image...or a nicer image ????
    if yes, the you can upload any image you need and then use it here...
    Tell me if you need more information...!!
    Hope this helps.
    <b><i>Do reward each useful answer..!</i></b>
    Thanks,
    Tatvagna.

  • Disappearing text and image

    I created letterhead in Pages for my lil brothers film production company. Saved. Exported the document to Word. Sent it to him. So far so good. Looks great. Each time he opens the document in WORD and trie to alter the text by selecting and typing over it both the text and the graphics disappear.
    Is there any way to correct this? I really love the letterhead and have been having problems recreating it in other software.

    Thanks for a quick response. I see yr point. The thing is I am setting up a table cell editor and a renderer. It is easy to set up the editor with a combo box. For the renderer, I am using a default cell renderer and I want to make it look like a combo box as well. Since the default cell renderer extends JLabel, I do something like
    comboBoxRenderer = new DefaultTableCellRenderer();
    ImageIcon image = new ImageIcon("image/Play16.gif");
    comboBoxRenderer.setIcon(image);
    comboBoxRenderer.setHorizontalTextPosition(JLabel.LEADING);
    which does not get me the effect I want. I can put more pixels between the text and image using setIconTextGap. But it is not fool proof. I think I will try yr approach, but then it gets a little complicated. Would have been good if there is simpler way. I will appreciate yr thoughts

  • Text and Image component Image placing not working!

    Hi Guys,
    For some odd reason, when I drop text and image component to the page I do not see the left or right option to place image in "Styles" tab.  The styles tab shows blank and by default paragraph gets placed after image.  This only happens in my site, not in Geomatrix. Am I missing something to include??
    Thanks in advance.

    geometrixx site has extended the text&image component thats why it shows that option. earlier in 5.4 version they directly overrided in geometrixx apps but now you wont find it there. But if you want to achieve this functionality then you have to override same component locally in your apps and add some more configuration to style tab as below.
    <tab4
                jcr:primaryType="cq:Widget"
                xtype="componentstyles">
                <items jcr:primaryType="cq:WidgetCollection">
                    <controlstyle
                        jcr:primaryType="cq:Widget"
                        fieldLable="ControlStyle"
                        name="./ControlStyle"
                        title="ControlStyle"
                        type="select"
                        xtype="selection">
                        <options jcr:primaryType="cq:WidgetCollection">
                            <Left
                                jcr:primaryType="nt:unstructured"
                                text="Left Align"
                                value="left"/>
                            <Right
                                jcr:primaryType="nt:unstructured"
                                text="Right Align"
                                value="right"/>
                        </options>
                    </controlstyle>
                </items>
            </tab4>

  • Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to be?

    Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to look?
    Everyone who logs into Facebook on my Firefox has this problem however if we use Internet Explorer - facebook looks normal.

    If you have increased the minimum font size then try the default setting "none" as a high value can cause issues like you described.
    * Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"

  • Text and images in the same component?

    Ok... a lil help please :
    into what component can i put text and images at the same time
    as in...
    example, what component could contain data like this :
    Hello this is me <imageofmyself> and this is my house <imageofmyhouse>... bye all !
    thanks in advance,
    Jonathan, a.k.a. Kyraz

    You could use a Swing HTMLPANE or draw it all onto a
    BufferedImage and display that (code posted under 2D graphics thread).
    MArk

  • Can only see text and image outlines

    I am new and got stuck!
    When I run the fla, it runs fine. However I have hit some setting and all I can see is the texts and image outlines...
    Here are some screen shots:
    This is what it looks like when i run it:
    Please help! its probably the most fundamental thing ever but I am stuck and it is hot and I'm frustrated. Thank-you

    Your timeline is set to outline view. At the top of the timeline, in the section where the names of each layer are shown, there are three icons: an eye, a lock and a box. Click on the box icon to switch between outline and normal view.

  • Resizing text and images with actions and keeping it resized for the next slides, how to?

    Hello everybody,
    I searched over the net and in this support section for a solution to my problem, but i didnt find any, so...here I am asking you experts.
    Through a particular use of different actions I make a logo "compose" in the first slide of my presentation (the logo is composed by text and images that interact), then in the second slide i make it resize so it goes 50% of its size and moves down like a TV logo, in the corner of the slide, and I want it to stay there for all the lenght of the presentation.
    It might be a stupid problem, but I didnt understand how to keep it there, 50% of its size and always in that position. If i duplicate the slide I obviously duplicate the 100%-size-logo, not its 50%-size-version, and if i shrink it in order to make it be 50% of its size the text size doesnt shrink so i have to change the text size manually, but the visual effect is imperfect.
    Lets summarize:
    slide 1: text appears, image appears, the text and the image move and "compose" the logo
    slide 2: the complete logo reduces its size to 50% and moves in the lower corner of the presentation, in the place I want it to be for, lets say, 20 slides
    slide 3: i want to have this logo already reduced in size and in its position, in the right lower corner, but if i try to group the different parts of the composed logo and i try to squeeze them the font doesnt change its size, I only squeeze the area that the text occupies.
    Some help please guys?
    Thanks in advance,
    Dom-
    (add: the problem is kind of similar to this: https://discussions.apple.com/message/9179367#9179367 . the idea of making a slide that contains the logo and text in the exact positions they would be after the move and scale actions is good and that was my first attempt, the probem is that it looks impossible to me to create a second "little" version of the logo that looks exactly the same of the first one that i reduced, so i hope there is some way to tell the app to use "the first logo, only resized the way i want", and thats the point where the problem with the size of the text comes out)

    Hi pritam,
    The “maintain proportions of window for different monitor
    resolutions” property will maintain the proportional size of the front panel
    (its x and y sizes) when opened in a different resolution. The front panel
    objects will not be resized and will appear larger (and may not fit inside the
    front panel) when saved in a higher resolution, and moved to a lower
    resolution. You can use the “Keep window proportions” property to achieve the
    same results.
    To have both the front panel dimensions and front panel
    controls scale, you need to have both the above property and the “scale all
    objects on front panel as the window resizes” selected. The labels will not be
    resized by this.
    I tried using both properties on two monitors and noticed
    that the change does not occur when the resolutions between the monitors are
    different. I had to lower both monitors’ resolution to see the change work
    properly.
    Please post back if you have any questions. Have a great day!
    Ryan D.
    District Sales Manager for Boston & Northern New England
    National Instruments

  • Is it possible to extract the text and images using PHP

    Hi friends,
    Is it possible to extract the text and images using PHP, in the same order as it is in the PDF?
    Else is it possible extract the same as XML using PHP, or ASP
    I googled it but its in vain, any help is appreciated.
    Thanks in advance.

    Dear Mike,
    Thanks for your quick reply,
    I mean is it possible to parse the PDF line by line using the PHP.
    I extracted the whole text but couldn't the images. Since the PDF's images are decoded using various methods like DCTDecode, JPXDecode, etc.
    The text is decoded with FlateDecode, which i breaked using a function in PHP.
    Thanks,

  • Installed update (11.0.08). App still crashes if I try to edit text and images. Any help?

    Installed update (11.0.08). App still crashes if I try to edit text and images. Any help?
    1)Specs:  Alienware M17 R4 (laptop)
    GPU: GeForce GTX 675M
    CPU: Intel(R) Core(TM)  i73840QM CPU @ 2.80GHz
    Memory: 16GB RAM (15.89 GB available)
    Resolution: 1920 x 1080, 60Hz
    OS: Windows 7 home premium
    2) There is no error message. Acrobat simply closes on me without warning. The program stays open for a brief time, but then closes at random.
    3) I have tried running it as an admin, but it does not change anything. The program still closes without my consent.
    4) I have tried installing and reinstalling multiple times. It does not work even if I do not get the update (11.0.08)
    Thanks,
    hiimwill

    In that case we might want to have a look at the crash logs to check what is failing.
    How to create a user-mode process dump file in Windows Vista and in Windows 7
    http://support.microsoft.com/kb/931673
    Also please be aware that if you are using a 64-bit system you need to follow a different procedure to collect the DMP file to avoid us getting  this error from the IDE when attempting to view the file “Debugging a 64-bit dump of a 32-bit process is not supported, please collect a 32-bit dump of a 32-bit process."
    You can get the correct dump by going to the location referenced in this blog excerpt:
    http://blogs.msdn.com/b/amb/archive/2011/05/12/do-not-collect-32bit-process-dumps-with-64b it-task-manager.aspx
    So, you need to use 32bit debugger, if you would like to collect a dump of a 32bit process. So, if your process is 32bit, then you need to run 32bit version of the task manager on a 64bit OS. 32bit task manager is located in C:\Windows\SysWOW64 folder and the name of the file is taskmgr.exe.
    Regards,
    Rave

  • When I click "edit" to manage content on a web page, I see code instead of text and images. How can I fix this?

    I edit content on www.fomh.org. Until recently, I could sign in as administrator, click "edit" in the editable area of a web page, and proceed to update text and images. I have been using Firefox to do this for several years. Now when I attempt to do this, I see all the html code in the editable area instead of the text and images.
    I am using Mac OS 10.6.8

    What is the content of that window?
    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    *Use a compressed image type like PNG or JPG to save the screenshot
    *Make sure that you do not exceed the maximum size of 1 MB
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Servlet: send back text and images to the requester

    Hi,
    I need some help about servlet responses.
    I want to send back some text (and maybe some images) back to the requester after a POST request.
    Can you give me some tips ?
    thanks

    aneuryzma wrote:
    I want to send back some text (and maybe some images) back to the requester after a POST request.
    Can you give me some tips ?Tip: Make up your mind. You can only send one thing as the response. If you want to send text, then send text. If you want to send an image, then send an image. In any case you should set the content type to indicate what you're sending.
    You can only send a mixed bag of text and images in the unlikely case that you've defined your own content type along with a client which understands it. Or if you zip them all into a zip archive, or something like that.

  • How can I erase the residual background text and images from the backside of a scanned page?

    How can I erase the residual background text and images from the backside of a scanned page?
    Also, I wanted to know what each subscriptions included as far as my question above is concerned?
    I am trying to edit a scanned page (pdf file) by changing some words and erasing the background from the page that is showing through it since the paper is so thin and want to know which subscription to buy in order to complete these tasks?

    This cannot be done in Reader. I think you will need software like Photoshop. You may be able to get buy with Photoshop Elements, but I haven't used recent versions of that software. Using either software this will not be an automated task.

Maybe you are looking for

  • How to get the data from the model node like a table ?

    I want to get the data from the model node  once a record ,and the node  is bound to a internal table in the RFM which I called in the R/3 system. Who can give me some advice to achive it?Thank you!!

  • DBW0: terminating instance due to error 27061

    Hi, PROD Db 9.2.0.8 AIX 5.2 Suddenly database crashed. What I found in alert log file and trace file find below. I started database it started normally but it took much time to start. Suggest me why it occurred and what I need to change so that I cou

  • [urgent] Flex fileRef.download problems.

    Hi all, I am having trouble figuring out what to do here. I am sending images to coldfusion, and using cfzip to create a zip of the images for download. I am using fileRef.download to download the zip to the user's computer in actionscript. The probl

  • Legacy vs User mailbox

    I understand the difference between the two. My question is; why would some moved, 2003 mailboxes' recipient type be Legacy while others, also moved from 2003, are User Mailboxes?

  • ATV worked then library just disappeared

    I fired up home sharing, added access to my main library. Set up 3 iPhones and 2 ipads as remotes. ATV working great as an airplay speaker selected via remote directly through my main library, also. AWESOME. Then, in the middle switching from one son