Need LayoutManager that resizes and supports right-aligned children

I have two labels that I want to appear inside JPanels such that
they have minimum 2 pixels padding between the text and the
border of the JPanel, and the leftmost label is right justified, while
the rightmost label is left justified. For example)
[+++++label1++][++label2+++++]
(the '+' represent white space/padding)
Additionally, the panels themselves are children of a JPanel that is
resized via a JSplitPane, so I want the labels to get truncated or
expanded depending on the size of their containing JPanel.
Lastly, I want to have the leftmost label right justified within its
containing JPanel, and the rightmost label to be left justified within
its containing JPanel.
I've found that FlowLayout doesn't work because once my text is
painted truncated, if the containing JPanel is resized larger, the
label does not change to fill the space.
What I'm seeing is that when the label is too large for the JPanel,
it correctly gets truncated such as:
[++lab...++]
'+' represents white space/padding
"..." implies truncated text
but when the JPanel is grown, it simply adds padding to the current
text that is painted:
[+++++++lab...++]
when I want it to expand the text and keep the result right justified:
[++++++label1++]
BoxLayout doesn't work because I can't find a way to get the text to
be right-justified within the JPanel.
BorderLayout isn't viable because while my example only shows a single
label in the JPanel, I could actually have many components to add
to the JPanel. So, I could create a JPanel to hold the many comps,
but then that JPanel would have the same issue with layout.
GridBag seems way overkill for what I need to do, which is simply,
right justify text that will be react to contain panel bounds changes.
Any advice is greatly appreciated.
-Andy.

Thanks for the reply. Unfortuneately, other circumstances prevent me from being
able to do it that way :(
I basically have very HTML-ish XML used to define a table.
The table uses a GridBagLayout that lays out the <td>'s that are
currently JPanel's. The <tr>'s do not create any JComponent as
they are simply used to define attributes that are applied to all
row <td>'s.
My XML looks something like:
<table>
  <tr>
    <td style="align: right; hgap: 2;"><label text="Hello"/></td>
    <td style="align: left; hgap: 2;"><label text="World"/></td>
  </tr>
</table>So, when this is displayed it should show like:
[++Hello++][++World++]
or when it's shrunk, it should become something like:
[++He...++][++Wo...++]
and when the row is grown, it should become something like:
[++++++Hello++][++World++++++]
Also, since the GUI is defined in the XML, there can be many labels,
images, etc inside one of the <td> tags, and I want them to be displayed
L to R within the <td> in the order they appear, but I want them to be
left or right justified with respect to the <td> JPanel.
Maybe I can use a Box as my <td> instead of a JPanel so I can
add a glue component on the left for right justified, and glue on the right
(or no glue component) for left justified? I'll try that next...
Thanks again for your help.
-Andy.

Similar Messages

  • My daughter is 12 and need books that highlight and read out loud how do i know whick book have that, i could only find kid books

    my daughter is 12 and i need books that highlight and read out loud, how do i know whick books do that

    Regarding the cursor moving on its own, see:
    My mouse keeps moving around on its own, as if someone is remotely controlling my Mac!
    This is not known behavior of Flashback.  To make sure you're not infected, just install any updates that are available in Software Update.  For more info on this, see About the Flashback malware.
    That e-mail just sounds like a phishing attempt, and trying to open and view the attached zip file is a major error!  It probably contains malware.  Fortunately for you, it's almost certainly Windows malware, as I've never yet heard of a case of Mac malware being sent via e-mail in this way.  But it could happen, so you should never, ever open attachments from people you don't know, especially in such suspicious circumstances!
    Finally, I, like etresoft, have never heard of Avira.  There's a lot of bad AV software out there, so without knowing more about it, I would agree that it should be removed, using whatever uninstaller is provided by Avira.  If you want to use AV software, use either Sophos Anti-Virus for Mac Home Edition or ClamXav.  Both are free and excellent.
    (Note that my pages contain links to other pages that promote my services, and this should not be taken as an endorsement of my services by Apple.)

  • Schedule for Maintenance and Support

    When do you expect to be at a point where you set product price and maintenance cost?
    Also, I assume that you will give existing MATRIXx customers a 'grace period' during which we can secure funds to resume paying for maintenance and support, right? I would expect something like 90 to 120 days in the grace period.
    Thanks.

    Michael -
    We are currently finalizing our price list, which will include product prices, maintenance, and all of NI's policies concerning maintenance and support.
    When this list is complete, it will be posted to ni.com/matrixx. Please check back for that information and all other updates, as they will be posted there as well. You can anticipate the new price list within the next two weeks.
    Regards,
    Greg Wempe
    Product Manager for MATRIXx
    National Instruments

  • How to Right Align the output of amount with currency?

    Hi,
    I have the following SQL query, which basically is the duplication of the SAP standard Item List.  The only difference is, the stock on hand is only for Warehouse 01.
    In the output, I manage to display eg: AUD 1321.00.  However, it is aligned to the center.  Is there a way that I can make it right align like the standard report?  Appreciate your help.
    SELECT T0.[ItemCode], T0.[ItemName], (select T100.OnHand from OITW T100 where T100.ItemCode=T0.ItemCode and T100.WhsCode='01') as 'InStock',T0.[CodeBars], T1.[ItmsGrpNam], T2.[FirmName], T0.[InvntryUom],
    ('AUD'+ replicate(' ',16-len(T0.[LstEvlPric])) + Convert (char(18),(cast ((round(T0.[LstEvlPric], 2)) as decimal(16,2))))  ) as 'Last Eval Price', (T0.[LastPurCur]+ replicate(' ',16-len(T0.[LastPurPrc])) + Convert (char(18),(cast ((round(T0.[LastPurPrc], 2)) as decimal(16,2))))  ) as 'Last Pur. Price',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=1 and T200.ItemCode=T0.ItemCode) as 'L 1',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=2 and T200.ItemCode=T0.ItemCode) as 'L 2',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=3 and T200.ItemCode=T0.ItemCode) as 'L 3',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=4 and T200.ItemCode=T0.ItemCode) as 'L 4',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=5 and T200.ItemCode=T0.ItemCode) as 'L 5',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=6 and T200.ItemCode=T0.ItemCode) as 'Price List 6',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=7 and T200.ItemCode=T0.ItemCode) as 'Price List 7',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=8 and T200.ItemCode=T0.ItemCode) as 'Price List 8',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=9 and T200.ItemCode=T0.ItemCode) as 'Price List 9',
    (SELECT T200.[Currency] + replicate(' ',16-len(T200.Price)) + Convert (char(18),(cast ((round(T200.[Price], 2)) as decimal(16,2)))) FROM ITM1 T200  INNER JOIN OPLN T201 ON T200.PriceList = T201.ListNum where T200.PriceList=10 and T200.ItemCode=T0.ItemCode) as 'Price List 10'
    FROM OITM T0  INNER JOIN OITB T1 ON T0.ItmsGrpCod = T1.ItmsGrpCod INNER JOIN OMRC T2 ON T0.FirmCode = T2.FirmCode

    Thanks. 
    But, does that mean the the right alignment in SAP Item list was done through UI? 
    Another question is:
    Normally, in an SAP query, when click Ctrl + left click the mouse at the bottom, I can see the total.
    However, with the query that I have created, it seems to cut off the first number.  Eg: The total should be AUD 231,123.00, but it is showing me AUD 31,123.
    Can you see how I can fix that?

  • Hyperion Planning Comments and Supporting Detail

    I understand that Comments and Supporting Detail are kept in SQL. The question is which DB (if not HYP_PLANNING) and what is the table? thanks...

    Cameron,
    You should be able to export a file from LCM in an automated fashion.
    My theoretical process involves four XML files (you could name these anything - these are just my names):
    1) Export_Migration_Definition.xml (This XML file tells the Utility.bat what to export into files 3 & 4 below - Comments and Supporting Detail.)
    2) Import_Migration_Definition.xml (This XML file tells the Utility.bat what to import into your Planning app - again Comments and Supporting Detail.)
    3) Cell Texts.xml (This is the file that LCM creates with cell text. We'll need to change the version name in this file.)
    4) Supporting Detail.xml (This is the file that LCM creates with supporting detail. We'll need to change the version name in this file.)
    So where did I get files 1 & 2? If you go into LCM, and setup a manual migration, at the end, you'll see a button to "Save Migration Definition". Planning will create these two files for you. You'll need to go through the motions as if you were going to execute an export, and an import. Except you won't go all the way. At the end of the process, instead of pressing "Execute Migration", you'll press "Save Migration Definition" instead.
    Once you've got the Export_Migration_Definition.xml and Import_Migration_Definition.xml, you can automate the export and import. At this point you'll be exporting and importing the same comments and supporting detail, just to make sure it works. Then you need to insert a step in your batch process that does a find/replace on the Version name. You'll be doing the find and replace on files 3 & 4 above. I used Google to find several examples of Find/Replace as part of a batch process.
    Please let me know if you see any holes in this. I really don't think you need to interact directly with the repository for either the export or the import. In reality, you don't want to import directly into the SQL repository anyway, because you would typically need to recycle Planning for your changes to take effect.
    Hope this helps,
    - Jake

  • Use desformat=spreadsheet output excel,number fields can not right align

    overview and PDF right align,it's ok.but excel all field left align.
    why?

    Be sure you put the heading the same size as your column because otherwise it will not insert the diffent columns in seperate columns in excell

  • I am verifying my account and I keep sending the email to verify it but it deosn't send. Then if I change my email it would send that I changed it so I know that I have the right email. I need help verifying my apple Id!!!

    Can anyone help me I keep sending the verifying thing to my e-mail but I don't get it. I know that it is the right e-mail because if I change it to my other one it sends a e-mail saying that I changed it, but it won't send the e-mail to verify it could anyone please help me??????????

    Hello, K4rla223. 
    Thank you for visiting Apple Support Communities.
    Try the steps in the article below to resend the verification email.  Make sure to check your email spam folders for this link.  You may have to access your spam folder via a web browser on a computer.
    Associating and verifying email addresses with your Apple ID
    http://support.apple.com/kb/HE68
    If you are still experiencing issues you may need to reach out to our account security team to help you with verifying your account.
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Cheers,
    Jason H.

  • After I download Itunes, when trying to sync Ipod, message says "needs newer version of mobile support, uninstall Itunes, and reinstall Itunes, and the same process starts all over again. why is that?

    after I download Itunes, when trying to sync Ipod, message says "needs newer version of mobile support, uninstall Itunes, and reinstall Itunes, and the same process starts all over again. why is that?

    Try removing and then reinstalling the Apple software using these instructions.
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    The above containes a link for XP. Also. make sure you install the correct Apple software, It comes in 32 and 64 bit and you need the one that is the same as the computer OS

  • I have recently installed windows XP on my bootcamp partition. I am in need for the drivers and what not so that it will run effectivly and the bootcamp assistant canot find the "Windows Support Sofware" Can anyone help me find it manually?

    As the title has stated, I have recently installed Windows XP on my Bootcamp Partition. I am in need of the "Windows Support Software". I am assumeing that is the information that has the Drivers and what not that allow me o properly use my Mac with windows. If anyone can help me locate this inforamtion i would be greatly.... Greatfull.
    P.S. The bootcamp assistant is telling me that the Windows Support Sofware canot be found.

    You both would have had correct awnsers, but i have a Macbook that is close to three years old. And i can't seem to find my Disc. The only reason i haven't ordered a new one in case of emergencies is I plan on upgrading to the new OS in less then a month.
    I think the following may help me (In case anyone els is looking):
    http://support.apple.com/kb/DL830

  • I've been trying to install Itunes.When I do everything goes right.Except one thing.It says that Apple Mobile Support can't Install cause some privileges. I don't know what to do.I recently bought my Iphone 4s and I can't do nothing without installing it.

    Every time I try to install Itunes to sync my Iphone. A pop up message appears saying that "Apple Mobile Support cant't download ( please check to see if you have enough privileges to run this program) I don't know what to do someone help me !!!!

    Lanakivee
    Try this it worked for me Pat Willener gave it to me off the site :
    I have not read all you wrote, so I may have missed some points. As I understand it, you installed FP 10 on IE7, but it won't play any Flash content?
    Try this
    download the FP uninstaller from http://www.adobe.com/go/tn_14157
    close all browser windows, then run the uninstaller
    download the offline ActivX installer for Internet Explorer from http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_ax.exe
    close all browser windows, then run the installer

  • I was trying to make a new screen recording using quicktimeplay, but when I watched the video after recording it all I could hear was me talking while the video was showing on the screen. How do I turn off that recording and turn the right one on? thanks

    I was trying to make a new screen recording using quicktimeplay, but when I watched the video after recording it all I could hear was me talking while the video was showing on the screen. How do I turn off that recording and turn the right one on? thanks

    Hi j2399123,
    It sounds like your screen recording is doing what it was designed to do, capture what is happening on your screen, with optional voice over with the microphone.
    Screen recording is for recording what you see on the screen, it is not a "video capture" option, like for capturing a movie with sound that is playing on your screen.
    For the QuickTime recording options, check out "Recording with QuickTime Player" in
    Mac Basics: QuickTime Player creates, plays, edits, and shares video and audio files
    http://support.apple.com/kb/ht4024
    And for screen recording specifically, there's
    QuickTime Player 10.x: Record your computer’s screen
    http://support.apple.com/kb/PH5882
    Thank you for thinking of Apple Support Communities for your support needs.
    Nubz

  • USELESS ONLINE HELP FACILITIES For all the amazing productivity aids that APPLE offers the world I have to report that their online support service is worse than useless and has recently been the source of immense time wasting and irritation.

    USELESS ONLINE HELP FACILITIES
    For all the amazing productivity aids that APPLE offers the world I have to report that their online support service is worse than useless and has recently been the source of immense time wasting and irritation.
    Incident 1. Since many months attempts to download new and updated APPs produced a response – Apple ID Disabled. I had no time to consult an APPLE Store due to work in distant lands. When I finally visited yesterday I was told that as my IPAD has been reported as stolen, and APPLE in its wisdom had blocked its usage! I am not sure how they became so misinformed and nobody every advised me while with a few swift moves APPLE could have located me by email address or SKYPE.
    Incident 2. Once the above anomaly had been fixed I tried to down load a newspaper and diligently input my address, credit card number and personal data. Repeatedly I was advised that my Credit Card was invalid and my postal code was incorrect! Really!
    I was left to guess that having moved from UK to the US I should have advised APPLE! Not being told of this requirement brought about a second visit to APPLE Store in the same day to waste both mine and their time with a routine anomaly. How parochial in the context of a globalized world!
    In each case I tried to resolve the issues using online access to a help line and by calling by phone at the numbers on the APPLE Website. In each of four separate occasions I diligently went through the routine and  ended up with a message that thanked me for contacting Apple followed by a polite ‘Good Bye’!
    In desperation I went to an Apple Store for the second time in a day as it is close to where I live when I am not working. On both occasions I was courteously attended to by Apple Staff.
    However, my work is usually far away from the US and it is generally many thousands of miles to the nearest Apple Store therefore online help is viewed as imperative if one is to resolve issues away from home.
    Why can Apple not provide a clearly marked EMAIL address and Telephone number at a Help Desk with real people to respond to requests for help? It would cost nothing in relative terms and might restore my high level of anti-APPLE sentiment that these two recent events have provoked.
    Peter Hanney
    Miami, Fl.

    Why can Apple not provide a clearly marked EMAIL address and Telephone number at a Help Desk with real people to respond to requests for help?
    If that is your question, the answer is at the bottom right of this web page. It is clearly marked "Contact Us" and is the best way, really the only way, to contact Apple.
    If there were a publicly posted email address for concerns such as yours, it would be quickly filled with spam in about three minutes, thereby becoming instantly useless to you and everyone else. Apple would need to change it hourly, if not more often. That is also the reason you ought not to post your name, location, and what appears to be your iPad's serial number on this publicly viewable website.
    Apple does not respond here and I can find no other questions for your fellow Apple users to answer.

  • How can I keep left- and right-aligned paragraphs together on the same line?

    I am currently trying to typeset a menu. Basically, I want the Dish Title to be left-aligned and the Price right-aligned — but on the same line. I can achieve the effect by typing in a shift+tab after the Dish Title text and then inserting the price, but I would rather have two distinct paragraphs styles, so that I can adjust them globally to see what looks good. I can achieve the effect by adjusting the Price character baseline of the price and moving it up, but then if I need to make any price changes, I find it a pain trying to get the cursor in the right place in situations where a baseline is substantially altered.
    Back in the old days (in Ventura!!), I could just remove the line break after the "Dish Title" style and the "Price" would move up to the same line, but I can't seem to be able to do this in CS6.
    Any ideas?

    Please show some examples. It's easier to help you.
    If I understand right, use a paragraph style with a right aligned tab and nested styles and grep styles. That's extremly flexible.
    Have fun

  • I need to download Apple Application Support package but have not found a site to facilitate that for a Windows 7 PCthis.

    Experienced problems with Itunes and research had me delete several apps.  I have downloaded Itunes but now I need to download Apple Application support. I have tried a couple of addresses found on Google but got a lot of spyware and not what I wanted.  Where is a site that I can download Apple Application support for Windows 7 64 bit machine?

    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64Setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleApplicationSupport.msi to do a standalone AAS install.

  • I wanted to know how to unlock my iphone, since I had to restore it and when it restarted, it appeared this message: "The SIM card que you currently have installed in this iphone is from a carrier that is not supported under the Currently actuvation polic

    I wanted to know how to unlock my iphone, since I had to restore it and when it restarted, it appeared this message: "The SIM card que you currently have installed in this iphone is from a carrier that is not supported under the Currently actuvation policy that is assigned by the server activion. this is not a hardware issue with the iPhone. Please insert another SIM card from a supported carrier or request que this iphone be unlocked by your carrier. Please contact Apple for more information. "
    I need help, I use my phone for everything enclusive to work. I appreciate if you can help. I'm from Brazil. My name and giullia.

    Did you purchase this device from Apple or an authorized reseller? It sounds as if you had a device that was jailbroken/hacked to operate on your carrier. Upon updating the iOS, it is now locked back to the original carrier the device was locked to.
    Only the carrier the device is locked to can authorize an unlock. You will need to make contact with that carrier and see if they provide unlocking services, and if they do, if you qualify for an unlock. Otherwise, you are out of luck. One that carrier can take care of the unlocking.

Maybe you are looking for

  • Bank stmt issue

    hifriends I have doubht, In FF67, Manual bank stmt display, in that bank stmt some transactions are showing Posting completed ,some transactions are showing posting incompleting, if we double click on posting incomplting status field showing  g/l pos

  • Hi  experts urgent

    hi all i have report in  ONE SERVER. In that  i am calling a zfunction module is a function module  which  is in another server.   in my report , there is a selection screen as agrrement number in <b><i>select option.</b></i> .i  ll give input to thi

  • Location of iCal Automator Scripts (Plugins?)

    AHHHH.  Apple you drive me crazy with this stuff!!! I need to alter an automator script I made for iCal.   ...  but I can't figure out where these things are stored in my hidden, buried, locked and unalterable system.  If I open a iCal set up in Auto

  • CS4 display differences under Snow Leopard?

    Maybe my recollection is wrong, but doesn't CS4 show a histogram of luminosity values in the curves window of an adjustment layer? I upgraded recently to Snow Leopard (Mac Pro 2x2.8 GHZ quad-core, 14 GB RAM) and now when I create a curves adjustment

  • System Preferences saying it needs to "quit and reopen".

    Hello! So, I upgraded from Leopard to Snow Leopard, and re-installed pretty much everything. The only thing I imported from 10.5 was the Perian PrefPane, because it was a modified version that allows you to chagne the size of the subtitles.. some dud