Align left panels inside BoxLayOut / Center a frame center screen

Hi,
I've googled for a good while now so now I'm posting the question I have not found a satisfactory answer. It may be that I've been searching by the wrong terms, because it's an easy thing in concept. This is a JSwing question and all terms below apply to that.
I have a method which takes a container that has a BoxLayout manager. Each item I add is a new row, which is good. The bad thing is that each item is centered aligned. I'm adding a label and textfield into a panel which I then add to the container. I have tried .setAlignmentX to the label, textfield, panel, and all combination pertaining. I can not for the life of me do it. Please see below for pertinent code.
public void addComponentsToPane(Container pane) {
pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));
JPanel user = new JPanel();
JLabel userL = new JLabel("Username: ");
JTextField userT = new JTextField(20);
user.add(userL);
user.add(userT);
user.setAlignmentX(Component.LEFT_ALIGNMENT);
I hate to put two questions in one thread, but I'm stuck and it's been a long weekend. How come frame.setLocationRelativeTo(null); doesn't set the frame to the center of the window. It's slightly off center; too far to the right and down.
Thanks in advance for any help given by the community. I appreciate it and hope I haven't broken any guidelines for the forum.

Go through the [url http://download.oracle.com/javase/tutorial/uiswing/layout/box.html]tutorial for BoxLayout where you will find working code samples. After that, if you still have a problem, post a [url http://mindprod.com/jgloss/sscce.html]SSCCE (Short, Self Contained, Compilable and Executable) that members can copy and run to see where you've slipped up.
db

Similar Messages

  • Can HTML emails be aligned left instead of center?

    Is it possible to tell Apple Mail to align HTML emails to the left instead of center? All Text emails are aligned to the left and most HTML are aligned center (which gives a lot of empty space to the left on a wide display). However, some HTML emails are aligned left. I wonder what determines this and how it can be affected?

    It's not really controlled by the sender either. There is no guarantee that html will render any particular way. Use pdf is appearance is important.

  • Make a square Panel inside a Frame (awt)

    Hi all. I have a Frame that contains an panel.
    The Frame has BorderLayout and panel is positioned Center in it, occuping all the space. However I want the Panel to be perfectly square.
    The Panel MUST have LayoutManager(null).
    If I call setSize(100,100) on Frame, the Frame incorporates the height to include the Windowsbar on top, and then the Panel won't be square.
    If I call SetSize(100,100) on Panel, the Frame don't display anything else than the Windowbar.
    How can I solve this? Am I missing something important?

    One more question please noah....
    My applet i dependent on the square panel like I said. However it is important that the applets Frame can be resized, but its panel must still be sqaure.
    My code goes as follows:
    class Spanel extends Frame{
        panel.setBackground(Color.red);
        panel.setLayout(null);
        panel.setSize(200,200);
        add("Center",panel);
        pack();
        show();
    this.addComponentListener(new java.awt.event.ComponentAdapter() {
          public void componentResized(ComponentEvent e) {
            int x = calculateFrameSize(e);
            panel.setSize(x,x);
            pack();
            show();
    calculateFrameSize() {
    // only returns the lowest number of
    //getWidth() and getHeight()
    }This code however will go in an infinite loop, calling
    COmponentResized over and over.
    How can I avoid the loop?

  • I want my spry horizontal accordian in explorer content table to be closed and also wont align left

    I've tried everything.  my accordian will stay closed when landing on the page in all browsers except explorer and also I can't get the tab text to align left no matter what I do.
    Here is the page http://www.lohud.com/legacy/advertising/mediakit/tjn_content_guide.html 
    Please help I've been at this for many many hours.
    Here is my code
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Main.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>The Journal News Media Group</title>
    <!-- InstanceEndEditable -->
    <style type="text/css">
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    text-align: center;
    background-image: url(images/backdrop.png);
    background-repeat: no-repeat;
    background-position:top center;
    background-color: #77787B;
    .pageLable {
    font-family: arial;
    font-size: 18pt;
    color: #00adf0;
    line-height: 25pt;
    vertical-align: middle;
    padding-top: 10px;
    .pageLableTagline {
    font-family: arial;
    font-size: 18pt;
    color: #A7A9AC;
    .BlueText {
    color: #00adf0 !important;
    .descriptionFont {
    font-family: arial;
    font-size: 10pt;
    line-height: 14pt;
    .labelSub {
    font-family: arial;
    font-size: 14px;
    color: #00adf0;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
    .content12 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    .fontNinePoint {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9px;
    .white {
    color: #FFF !important;
    </style>
    <!-- InstanceBeginEditable name="head" -->
    <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
    <!-- InstanceEndEditable -->
    <style type="text/css">
    a:link {
    text-decoration: none;
    a:visited {
    text-decoration: none;
    a:hover {
    text-decoration: underline;
    a:active {
    text-decoration: none;
    body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    h1,h2,h3,h4,h5,h6 {
    font-family: Arial, Helvetica, sans-serif;
    h6 {
    font-size: 8px;
    color: #000;
    h4 {
    font-size: 12px;
    .fontsmall {
    font-size: 9pt;
    </style>
    <style type="text/css">
    </style>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body leftmargin="0">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><table width="906" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="126" rowspan="3"><a href="index.html"><img src="images/Logo_Nav_Black.jpg" alt="The Journal News Media Group" width="126" height="132" border="0" longdesc="index.html" /></a></td>
              <td width="780" height="30" align="right" valign="top"><table width="657" border="0" align="right" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="61" height="32" align="right" valign="middle"> </td>
                  <td width="372" align="right" valign="middle"><a href="http://www.linkedin.com/groups/Journal-News-Media-Group-4828545?trk=myg_ugrp_ovr" target="_new"><img src="images/linkedin.png" alt="linkedin" width="16" height="16" border="0" /></a></td>
                  <td width="37" align="center" valign="middle"><a href="http://www.facebook.com/pages/The-Journals-News-Media-Group/124999397672489" target="_new"><img src="images/facebook.png" alt="facebook" width="8" height="16" border="0" /></a></td>
                  <td width="90" align="center" valign="middle" nowrap="nowrap" class="white" style="font-size:12px"><strong><a href="newsletter.html" class="white">newsletter</a></strong></td>
                  <td width="24" align="center" valign="middle" class="white" style="font-size:12px"><img src="images/dot.png" alt="" width="9" height="9" /></td>
                  <td width="90" align="center" valign="middle" nowrap="nowrap" class="white" style="font-size:12px"><strong>  <a href="contact.html" class="white">contact us  </a></strong></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td align="right" valign="top"><table width="657" border="0" align="right" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="75" bgcolor="#000000"> </td>
                  <td width="369" bgcolor="#000000"><ul id="MenuBar1" class="MenuBarHorizontal">
                    <li class="MenuBarItemSubmenu"><a href="#">About</a>
                      <ul>
                        <li><a href="our_brand.html">Our Brand</a></li>
                        <li><a href="our_audience.html">Our Audience</a></li>
                        <li><a href="giving_back.html">Giving Back</a></li>
                        <li><a href="careers.html">Careers</a></li>
                        </ul>
                      </li>
                    <li><a href="digital.html" >Digital</a>                  </li>
                    <li><a href="#">Print</a>
                      <ul>
                        <li><a class="MenuBarItemSubmenu" href="#">Journal News</a>
                          <ul>
                            <li><a href="tjn_content_guide.html">Content Guide</a></li>
                            <li><a href="tjn_print_reach.html">Print Reach</a></li>
                            </ul>
                          </li>
                        <li><a href="special_sections.html">Special Sections</a></li>
                        <li><a href="creative_ad_units.html">Creative Ad Units</a></li>
                        <li><a href="zoning_guide.html">Zoning Guide</a></li>
                        </ul>
                      </li>
                    <li><a href="events.html">Events</a>
                      <ul>
                        <li><a href="golf_show.html">Golf Show</a></li>
                        <li><a href="theater_awards.html">Metropolitan High School Theater Awards</a></li>
                        <li><a href="rockland.html">Rockland Scholar Athlete</a></li>
                        <li><a href="ray_rice_day.html">Ray Rice Day</a></li>
                        <li><a href="cookie_swap.html">Cookie Swap</a></li>
                        <li><a href="give_grow.html">Give &amp; Grow</a></li>
                        </ul>
                      </li>
                    <li><a href="#"> Specs</a>
                      <ul>
                        <li><a href="print_specs.html">Print Specs</a></li>
                        <li><a href="digital_specs.html">Digital Specs</a></li>
                        <li><a href="deadlines.html">Deadlines</a></li>
                        <li><a href="terms_conditions.html">Terms &amp; Conditions</a></li>
                        </ul>
                      </li>
                  </ul></td>
    </tr>
                <tr> </tr>
              </table></td>
            </tr>
            <tr>
              <td height="70" align="right" valign="top"> </td>
            </tr>
          </table>
          <table width="906" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="40"> </td>
            </tr>
        </table></td>
      </tr>
    </table>
    <!-- InstanceBeginEditable name="MainTable" -->
    <table width="906" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="300" valign="top" bgcolor="#FFFFFF"><table width="906" border="0" align="center" cellpadding="10" cellspacing="0">
          <tr>
            <td height="57" align="left" valign="top" class="pageLable">Content Guide  <span class="pageLableTagline">lohud.com</span></td>
          </tr>
        </table> <div id="Accordion1" class="Accordion" tabindex="0">
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">News</div>
            <div class="AccordionPanelContent">
              <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="684" align="left" valign="top" class="descriptionFont"><strong>Content: </strong>The latest headlines, by county, updated continuously to keep readers informed of breaking news as it happens. Here is where they go to first for the latest on issues of particular importance to area residents: crime, politics, business, education, health and New York State news.<br />
                    <strong><br />
                    Advertiser Advantage:</strong> Benefit from prime positioning and high visibility on one of the most frequently<br />
                    visited pages on lohud.com.</td>
                  <td width="180" align="right"><img src="images/digital/contentguide/lh-news.jpg" alt="News" width="180" height="154" border="0" /></td>
                </tr>
              </table>
            </div>
          </div>
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">Tax Watch</div>
            <div class="AccordionPanelContent">
              <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="685" align="left" valign="top" class="descriptionFont"><strong>Content: </strong>Money and taxes. It’s a passion topic that many area residents have a keen interest in following. Our standing Tax Watch feature on LoHud.com keeps them in-the-know with watchdog columns on government accountability, blogs from local tax experts, timely articles and columns.<br />
                    <strong><br />
                    Advertiser Advantage:</strong> Ideal environment for financial, banks, real estate, and business.</td>
                  <td width="179" align="right"><img src="images/digital/contentguide/lh-taxwatch.jpg" alt="Tax Watch" width="179" height="155" border="0" /></td>
                </tr>
              </table>
            </div>
          </div>
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">Communities</div>
            <div class="AccordionPanelContent">
              <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="684" align="left" valign="top" class="descriptionFont"><strong>Content: </strong>Sixteen ultra-local homepages dedicated to the unique villages, towns and cities of Westchester County, with daily updates, photos and neighborhood conversations designed to involve <br />
                    and engage readers — and have them returning regularly for updates.<br />
                    <strong><br />
                    Advertiser Advantage: </strong>Ideal for smaller advertisers looking to reach their best potential customers<br />
                    within targeted geographic areas.</td>
                  <td width="181" align="right"><img src="images/digital/contentguide/lh-community.jpg" alt="Communities" width="179" height="158" border="0" /></td>
                </tr>
              </table>
            </div>
          </div>
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Living Here</div>
            <div class="AccordionPanelContent">
              <table width="865" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="686" align="left" valign="top" class="descriptionFont"><strong>Content:</strong> Awarded “First Place Winner/Niche Website” by the 2012 New York Associated Press! Offers an insider’s look at Lower Hudson Valley real estate for residents looking to buy, sell up, downsize or plan a renovation.<br />
                    <strong><br />
                    Advertiser Advantage:</strong> Ideal for real estate, financial, and home-related businesses. Provides a locally driven and highly targeted environment for your message.</td>
                  <td width="179" align="right"><img src="images/digital/contentguide/lh-livinghere.jpg" alt="News" width="179" height="155" border="0" /></td>
                </tr>
              </table>
            </div>
        </div>
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Sports</div>
      <div class="AccordionPanelContent">
        <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="684" align="left" valign="top" class="descriptionFont"><strong>Content:</strong> Comprehensive and updated frequently to keep fans up to date with the latest action from high school, college, major-league teams. Featuring game results, profiles of local athletes, perspective, commentary and blogs for reader interaction.<br />
              <strong><br />
              Advertiser Advantage:</strong> Action-packed environment for auto aftermarket, sporting goods, financial,<br />
              men’s interests, orthopedic and physical therapy businesses.</td>
            <td width="180" align="right"><img src="images/digital/contentguide/lh-sports.jpg" alt="Sports" width="180" height="158" border="0" /></td>
          </tr>
        </table>
      </div>
    </div>
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Blogs</div>
      <div class="AccordionPanelContent">
        <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="683" align="left" valign="top" class="descriptionFont"><strong>Content:</strong> Can we talk? We sure can…and readers love to hear what our writers and editors have<br />
    to say. Our lively Blogs site is where they can turn to for conversation and opinion on all kinds of <br />
    subjects — community, lifestyle &amp; entertainment, news, opinion and sports, including our extremely popular Yankees blog.<br />
              <strong><br />
              Advertiser Advantage:</strong> Benefit from prime positioning and visibility on highly targeted pages that offer maximum impact and response.</td>
            <td width="181" align="right"><img src="images/digital/contentguide/lh-blogs.jpg" alt="News" width="181" height="157" border="0" /></td>
          </tr>
        </table>
      </div>
    </div>
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Multimedia</div>
      <div class="AccordionPanelContent">
        <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="684" align="left" valign="top" class="descriptionFont"><strong>Content:</strong> A picture is worth a thousand words and this photo/video gallery keeps readers involved and engaged with compelling local photos from the week and informative feature videos on trending stories.<br />
              <strong><br />
              Advertiser Advantage:</strong> Ideal for retailers of all kinds, benefit from prime positioning and visibility on<br />
              highly targeted pages.</td>
            <td width="178" align="right"><img src="images/digital/contentguide/lh-multimedia.jpg" alt="Multimedia" width="178" height="157" border="0" /></td>
          </tr>
        </table>
      </div>
    </div>
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Life & Leisure</div>
      <div class="AccordionPanelContent">
        <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="684" align="left" valign="top" class="descriptionFont"><strong>Content:</strong> The perfect complement to our daily “Life &amp; Style” print section, it’s where readers go to be inspired and entertained! Featuring complete local restaurant and food coverage, weddings/engagement announcements, home &amp; garden tips, movie &amp; TV reviews, music and more.<br />
              <strong><br />
              Advertiser Advantage:</strong> Ideal weekly environment for restaurants, entertainment and leisure-related<br />
              businesses.</td>
            <td width="180" align="right"><img src="images/digital/contentguide/lh-lifeleisure.jpg" alt="Life and Leisure" width="180" height="158" border="0" /></td>
          </tr>
        </table>
      </div>
    </div>
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Opinion</div>
      <div class="AccordionPanelContent">
        <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="684" align="left" valign="top" class="descriptionFont"><strong>Content:</strong> Everybody’s got one — and this is where it counts. Our Opinion page on LoHud.com is just <br />
              that: opinions on the issues of the day, from our staff and from our readers, designed to inform, inspire and encourage interaction. Find editorials by our writers and editors, commentary, letters, editorial board surveys and more.<br />
              <strong><br />
              Advertiser Advantage:</strong> Benefit from prime positioning and visibility on highly targeted pages that offer maximum impact and response.</td>
            <td width="178" align="right"><img src="images/digital/contentguide/lh-opinion.jpg" alt="Opinion" width="178" height="156" border="0" /></td>
          </tr>
        </table>
      </div>
    </div>
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Obituaries</div>
      <div class="AccordionPanelContent">
        <table width="864" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="684" align="left" valign="top" class="descriptionFont"><strong>Content:</strong> Comprehensive and complete, with death notices, memorials, touching tributes and <br />
              convenient interactive features such as a search feature, free obituary alerts, one-click access to flowers and services, guest book signing and more.<br />
              <strong><br />
              Advertiser Advantages:</strong> Ideal environment for funeral homes, estate planners and florists.</td>
            <td width="178" align="right"><img src="images/digital/contentguide/lh-obits.jpg" alt="Obituaries" width="178" height="154" border="0" /></td>
          </tr>
        </table>
      </div>
    </div>
        </div>   
        <p> </p></td>
      </tr>
    </table>
    <script type="text/javascript">
    var Accordion1 = new Spry.Widget.Accordion("Accordion1",{ useFixedPanelHeights: false, defaultPanel: -1 });
    </script>
    <!-- InstanceEndEditable -->
    <table width="906" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="19" align="center" valign="middle" bgcolor="#77307d" class="white" style="font-size:12px"> <a href="contact.html"><img src="images/contactAnAdvert.png" alt="Contact an advertising expert" width="336" height="18" border="0" /></a></td>
        </tr>
      <tr>
        <td height="19" align="center" valign="middle" class="white" style="font-size:12px"><p><br />
        1133 Westchester Avenue, Suite N-110, White Plains, NY 10604   <img src="images/dot.png" width="9" height="9" alt="dot" />  P: 914-694-5500</p>
        <p> </p>
        <p><a href="http://www.gannett.com/" target="_new"><img src="images/Gannett.png" alt="Gannett" width="130" height="18" border="0" /></a><br />
          <br />
          Copyright © 2013<a href="http://www.lohud.com/" target="_new" class="white"> www.lohud.com</a>. All rights reserved.<br />
          Users of this site agree to the <a href="http://www.lohud.com/section/terms" target="_new" class="white">Terms of Service</a>, <a href="http://www.lohud.com/section/privacy" target="_new" class="white">Privacy Notice/Your California Privacy Rights</a>, and <a href="http://www.lohud.com/section/privacy#adchoices&gt;&lt;http://www.lohud.com/section/privacy #adchoices" target="_new" class="white">Ad Choices</a> <br />
        </p></td>
        </tr>
    </table>
    <p> </p>
    <table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>  </tr>
    </table>
    <p> </p>
    <p> </p>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    <!-- InstanceEnd --></html>

    It just wont align left ......This is my style sheet
    @charset "UTF-8";
    /* SpryAccordion.css - version 0.5 - Spry Pre-Release 1.6.1 */
    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
    .Accordion {
    overflow: hidden;
    outline:none;
    border-top-width: 0px;
    border-right-width: 0px;
    border-bottom-width: 0px;
    border-left-width: 0px;
    text-align: left;
    .AccordionPanel {
    margin: 0px;
    padding: 0px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12pt;
    /* This is the selector for the AccordionPanelTab. This container houses
    * the title for the panel. This is also the container that the user clicks
    * on to open a specific panel.
    * The name of the class ("AccordionPanelTab") used in this selector is not necessary
    * to make the widget function. You can use any class name you want to style an
    * accordion panel tab container.
    * NOTE:
    * This rule uses -moz-user-select and -khtml-user-select properties to prevent the
    * user from selecting the text in the AccordionPanelTab. These are proprietary browser
    * properties that only work in Mozilla based browsers (like FireFox) and KHTML based
    * browsers (like Safari), so they will not pass W3C validation. If you want your documents to
    * validate, and don't care if the user can select the text within an AccordionPanelTab,
    * you can safely remove those properties without affecting the functionality of the widget.
    .AccordionPanelTab {
    margin: 0px;
    padding: 2px;
    cursor: pointer;
    -moz-user-select: none;
    -khtml-user-select: none;
    text-align: left;
        padding-left: 10px;
    color: #000000;
    background-color: #c0dff5;
    border-bottom-width: 6px;
    border-bottom-style: solid;
    border-bottom-color: #FFF;
    text-indent: 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12pt;
    /* This is the selector for a Panel's Content area. It's important to note that
    * you should never put any padding on the panel's content area if you plan to
    * use the Accordions panel animations. Placing a non-zero padding on the content
    * area can cause the accordion to abruptly grow in height while the panels animate.
    * Anyone who styles an Accordion *MUST* specify a height on the Accordion Panel
    * Content container.
    * The name of the class ("AccordionPanelContent") used in this selector is not necessary
    * to make the widget function. You can use any class name you want to style an
    * accordion panel content container.
    .AccordionPanelContent {
    overflow: auto;
    outline:none
    margin: 0px;
    text-align: justify;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12pt;
    padding-left: 10px;
    padding-right: 10px;
    height: 200px;
    /* This is an example of how to change the appearance of the panel tab that is
    * currently open. The class "AccordionPanelOpen" is programatically added and removed
    * from panels as the user clicks on the tabs within the Accordion.
    .AccordionPanelOpen .AccordionPanelTab {
    background-color: c0dff5;
    color: #666;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12pt;
    /* This is an example of how to change the appearance of the panel tab as the
    * mouse hovers over it. The class "AccordionPanelTabHover" is programatically added
    * and removed from panel tab containers as the mouse enters and exits the tab container.
    .AccordionPanelTabHover {
    color: #999999;
    background-color: c0dff5;
    .AccordionPanelOpen .AccordionPanelTabHover {
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12pt;
    /* This is an example of how to change the appearance of all the panel tabs when the
    * Accordion has focus. The "AccordionFocused" class is programatically added and removed
    * whenever the Accordion gains or loses keyboard focus.
    .AccordionFocused .AccordionPanelTab {
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12pt;
    text-align: left;
    /* This is an example of how to change the appearance of the panel tab that is
    * currently open when the Accordion has focus.
    .AccordionFocused {
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    .AccordionPanelOpen
    .AccordionPanelTab {
    background-color: c0dff5;
    color: #666;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12pt;
    /* Rules for Printing */
    @media print {
      .Accordion {
      overflow: visible !important;
      .AccordionPanelContent {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    font-size: 12pt;
    padding-left: 10px;
    padding-right: 10px;

  • How to drag image in left panel then drop into right panel??

    Dear friends.
    I have following code, it is runnable, just add two jpg image files is ok, to run.
    I tried few days to drag image from left panel then drop into right panel or vice versa, but not success, can any GUI guru help??
    Thanks.
    Sunny
    [1]. main code/calling code:
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class ImagePanelCall extends JComponent {
         public  JSplitPane ImagePanelCall() {
              setPreferredSize(new Dimension(1200,300));
              JSplitPane          sp = new JSplitPane();
              sp.setPreferredSize(new Dimension(1200,600));
              sp.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
              add(sp);
              ImagePanel     ip = new ImagePanel();
              ImagePanel     ip1 = new ImagePanel();
              ip.setPreferredSize(new Dimension(600,300));
              ip1.setPreferredSize(new Dimension(600,300));
              sp.setLeftComponent(ip);// add left part
              sp.setRightComponent(ip1);// add right part
              sp.setVisible(true);
              return sp;
         public static void main(String[] args) {
              JFrame frame = new JFrame("Test transformable images");
              ImagePanelCall  ic = new ImagePanelCall();
              frame.setPreferredSize(new Dimension(1200,600));
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.getContentPane().add(ic.ImagePanelCall(), BorderLayout.CENTER);
              frame.pack();
              frame.setVisible(true);
    }[2]. code 2
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class ImagePanel extends JComponent {
         private static final Cursor DEFAULT_CURSOR = new Cursor(Cursor.DEFAULT_CURSOR);
         private static final Cursor MOVE_CURSOR = new Cursor(Cursor.MOVE_CURSOR);
         private static final Cursor VERTICAL_RESIZE_CURSOR = new Cursor(Cursor.N_RESIZE_CURSOR);
         private static final Cursor HORIZONTAL_RESIZE_CURSOR = new Cursor(Cursor.W_RESIZE_CURSOR);
         private static final Cursor NW_SE_RESIZE_CURSOR = new Cursor(Cursor.NW_RESIZE_CURSOR);
         private static final Cursor NE_SW_RESIZE_CURSOR = new Cursor(Cursor.NE_RESIZE_CURSOR);
         public Vector images;
         * Create an ImagePanel with two images in.
         * A MouseHandler instance is added as mouse listener and mouse motion listener.
         public ImagePanel() {
              images = new Vector();
              images.add(new TransformableImage("swing/dnd/Bird.gif"));
              images.add(new TransformableImage("swing/dnd/Cat.gif"));
              setPreferredSize(new Dimension(600,600));
              MouseHandler mh = new MouseHandler();
              addMouseListener(mh);
              addMouseMotionListener(mh);
         * Simply paint all the images contained in the Vector images, calling their method draw(Graphics2D, ImageObserver).
         public void paintComponent(Graphics g) {
              Graphics2D g2D = (Graphics2D)g;
              for (int i = images.size()-1; i>=0; i--) {     
                   ((TransformableImage)images.get(i)).draw(g2D, this);
         * Inner class defining the behavior of the mouse.
         final class MouseHandler extends MouseInputAdapter {
              private TransformableImage draggedImage;
              private int transformation;
              private int dx, dy;
              public void mouseMoved(MouseEvent e) {
                   Point p = e.getPoint();
                   TransformableImage image = getImageAt(p);
                   if (image != null) {
                        transformation = image.getTransformation(p);
                        setConvenientCursor(transformation);
                   else {
                        setConvenientCursor(-1);
              public void mousePressed(MouseEvent e) {
                   Point p = e.getPoint();
                   draggedImage = getImageAt(p);
                   if (draggedImage!=null) {
                        dx = p.x-draggedImage.x;
                        dy = p.y-draggedImage.y;
              public void mouseDragged(MouseEvent e) {
                   if (draggedImage==null) {
                        return;
                   Point p = e.getPoint();
                   repaint(draggedImage.x,draggedImage.y,draggedImage.width+1,draggedImage.height+1);
                   draggedImage.transform(p, transformation,dx,dy);
                   repaint(draggedImage.x,draggedImage.y,draggedImage.width+1,draggedImage.height+1);
              public void mouseReleased(MouseEvent e) {
                   Point p = e.getPoint();
                   draggedImage = null;
         * Utility method used to get the image located at a Point p.
         * Returns null if there is no image at this point.
         private final TransformableImage getImageAt(Point p) {
              TransformableImage image = null;
              for (int i = 0, n = images.size(); i<n; i++) {     
                   image = (TransformableImage)images.get(i);
                   if (image.contains(p)) {
                        return(image);
              return(null);
         * Sets the convenient cursor according the the transformation (i.e. the position of the mouse over the image).
         private final void setConvenientCursor(int transfo) {
              Cursor currentCursor = getCursor();
              Cursor newCursor = null;
              switch (transfo) {
                   case TransformableImage.MOVE : newCursor = MOVE_CURSOR;
                        break;
                   case TransformableImage.RESIZE_TOP : newCursor = VERTICAL_RESIZE_CURSOR;
                        break;
                   case TransformableImage.RESIZE_BOTTOM : newCursor = VERTICAL_RESIZE_CURSOR;
                        break;
                   case TransformableImage.RESIZE_LEFT : newCursor = HORIZONTAL_RESIZE_CURSOR;
                        break;
                   case TransformableImage.RESIZE_RIGHT : newCursor = HORIZONTAL_RESIZE_CURSOR;
                        break;
                   case TransformableImage.RESIZE_TOP_LEFT_CORNER : newCursor = NW_SE_RESIZE_CURSOR;
                        break;
                   case TransformableImage.RESIZE_TOP_RIGHT_CORNER : newCursor = NE_SW_RESIZE_CURSOR;
                        break;
                   case TransformableImage.RESIZE_BOTTOM_LEFT_CORNER : newCursor = NE_SW_RESIZE_CURSOR;
                        break;
                   case TransformableImage.RESIZE_BOTTOM_RIGHT_CORNER : newCursor = NW_SE_RESIZE_CURSOR;
                        break;
                   default : newCursor = DEFAULT_CURSOR;
              if (newCursor != null && currentCursor != newCursor) {
                   setCursor(newCursor);
         public static void main(String[] args) {
              JFrame frame = new JFrame("Test transformable images");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.getContentPane().add(new ImagePanel(), BorderLayout.CENTER);
              frame.pack();
              frame.setVisible(true);
    }[3]. code 3
    import java.awt.*;
    import javax.swing.*;
    import java.awt.image.*;
    public final class TransformableImage extends Rectangle {
         public static final int MOVE = 0;
         public static final int RESIZE_TOP = 10;
         public static final int RESIZE_BOTTOM = 20;
         public static final int RESIZE_RIGHT = 1;
         public static final int RESIZE_LEFT = 2;
         public static final int RESIZE_TOP_RIGHT_CORNER = 11;
         public static final int RESIZE_TOP_LEFT_CORNER = 12;
         public static final int RESIZE_BOTTOM_RIGHT_CORNER = 21;
         public static final int RESIZE_BOTTOM_LEFT_CORNER = 22;
         public static final int BORDER_THICKNESS = 5;
         public static final int MIN_THICKNESS = BORDER_THICKNESS*2;
         private static final Color borderColor = Color.black;
         private Image image;
         * Create an TransformableImage from the image file filename.
         * The TransformableImage bounds (inherited from the class Rectangle) are setted to the corresponding values.
         public TransformableImage(String filename) {
              ImageIcon ic = new ImageIcon(filename);
              image = ic.getImage();
              setBounds(0,0,ic.getIconWidth(), ic.getIconHeight());
         * Draw the image rescaled to fit the bounds.
         * A black rectangle is drawn around the image.
         public final void draw(Graphics2D g, ImageObserver observer) {
              Color oldColor = g.getColor();
              g.setColor(borderColor);
              g.drawImage(image, x, y, width, height, observer);
              g.draw(this);
              g.setColor(oldColor);
         * Return an int corresponding to the transformation available according to the mouse location on the image.
         * If the point p is in the border, with a thickness of BORDER_THICKNESS, around the image, the corresponding
         * transformation is returned (RESIZE_TOP, ..., RESIZE_BOTTOM_LEFT_CORNER).
         * If the point p is located in the center of the image (i.e. out of the border), the MOVE transformation is returned.
         * We allways suppose that p is contained in the image bounds.
         public final int getTransformation(Point p) {
              int px = p.x;
              int py = p.y;
              int transformation = 0;
              if (py<(y+BORDER_THICKNESS)) {
                   transformation += RESIZE_TOP;
              else
              if (py>(y+height-BORDER_THICKNESS-1)) {
                   transformation += RESIZE_BOTTOM;
              if (px<(x+BORDER_THICKNESS)) {
                   transformation += RESIZE_LEFT;
              else
              if (px>(x+width-BORDER_THICKNESS-1)) {
                   transformation += RESIZE_RIGHT;
              return(transformation);
         * Move the left side of the image, verifying that the width is > to the MIN_THICKNESS.
         public final void moveX1(int px) {
              int x1 = x+width;
              if (px>x1-MIN_THICKNESS) {
                   x = x1-MIN_THICKNESS;
                   width = MIN_THICKNESS;
              else {
                   width += (x-px);
                   x = px;               
         * Move the right side of the image, verifying that the width is > to the MIN_THICKNESS.
         public final void moveX2(int px) {
              width = px-x;
              if (width<MIN_THICKNESS) {
                   width = MIN_THICKNESS;
         * Move the top side of the image, verifying that the height is > to the MIN_THICKNESS.
         public final void moveY1(int py) {
              int y1 = y+height;
              if (py>y1-MIN_THICKNESS) {
                   y = y1-MIN_THICKNESS;
                   height = MIN_THICKNESS;
              else {
                   height += (y-py);
                   y = py;               
         * Move the bottom side of the image, verifying that the height is > to the MIN_THICKNESS.
         public final void moveY2(int py) {
              height = py-y;
              if (height<MIN_THICKNESS) {
                   height = MIN_THICKNESS;
         * Apply a given transformation with the given Point to the image.
         * The shift values dx and dy are needed for move tho locate the image at the same relative position from the cursor (p).
         public final void transform(Point p, int transformationType, int dx, int dy) {
              int px = p.x;
              int py = p.y;
              switch (transformationType) {
                   case MOVE : x = px-dx; y = py-dy;
                        break;
                   case RESIZE_TOP : moveY1(py);
                        break;
                   case RESIZE_BOTTOM : moveY2(py);
                        break;
                   case RESIZE_LEFT : moveX1(px);
                        break;
                   case RESIZE_RIGHT : moveX2(px);
                        break;
                   case RESIZE_TOP_LEFT_CORNER : moveX1(px);moveY1(py);
                        break;
                   case RESIZE_TOP_RIGHT_CORNER : moveX2(px);moveY1(py);
                        break;
                   case RESIZE_BOTTOM_LEFT_CORNER : moveX1(px);moveY2(py);
                        break;
                   case RESIZE_BOTTOM_RIGHT_CORNER : moveX2(px);moveY2(py);
                        break;
                   default :
    }

    I gave you a simple solution in your other posting. You never responded to the suggestion stating why the given solution wouldn't work, so it can't be that urgent.

  • Slideshow vertical hero image aligns left

    Using the slideshow widget with a vertical image sometimes results in the hero image randomly aligning to the left instead of centered. All the hero images are positioned in the center of the content area. The slideshow frame is the full width of the content area so that each image slides in from right to left (due to the Horizontal setting for Transition). The Y coordinate is 10 for the slideshow content (and the hero image container). Horizontal images have not shown a shift to the left. Not all vertical images exibit the behaviour (one slideshow with 20 images, 5 of them vertical, had 4 which shifted left, one displayed properly centered).
    I have only seen this on my Phone layout, not on the Tablet or Desktop layouts. The problem shows when in Preview mode, Preview Page in Browser and on an iPhone 4s.
    NOTE: After further troubleshooting I found something that seems to resolve the issue. If I move the Y coordinate of the image to 11 (slideshow content is at Y: 10) the image stops shifting to the far left and aligns properly to the center. It doesn't make sense, since other horizontal images are set at Y: 10 and even a few pixels taller but have not exibited the problem.

    I noticed when I add a drop shadow to the hero image in the slide show, the hero image when viewed in browser or preview, then aligns left, when I remove the drop shadow from the hero image, then the content is properly aligned.

  • How to right align s:Label inside a s:controlBarContent ?

    My spark app has a control bar at the top and i want to right-align a label inside it so my button bar is on the left and my label is on the right. I tried using the 'horizontalAlign="right"' which works find inside a s:panel but not inside a s:controlBarContent. Does anyone have any idea how to achieve this please? Also, the flash builder 4 ide won't let you move the label over in design mode either...
    Thanks for your help,
    Regards,
    Mark.

    I figured it out myself. I added an s:Hgroup around my label and set width="100%" and horizontalAlign="right" you need to set the width to 100% otherwise you're just right aligning within the actual width of the component (which is pretty useless eh?).
    I hope this helps someone else too.
    Regards,
    Mark.

  • In ALV I want to align Top-Of-Page in Center which contains some TEXT

    Hi Abap Gurus',
                          In ALV's i want to align TOP-OF-PAGE in center.
    Which contains some TEXT.
    Can you please help me out.
    Points will be Given.
    Many thanks
    Anil Roy.

    hi anil
    The header line is always left-justified .
    We basically have three options for formatting :
    S , A and H.
    every line in Alv top-of-page is of 60 char length(slis_listheader-info).so i think the only option we have is to add required spaces to the left and display the required string
    regards
    navjot
    reward if helpfull

  • Aligning text horizontally inside a rectangle shape?

    I have text on top of a rectangle made with a shape layer. I now want to align the text in the center of the rectangle shape. I select both layers, though the option to align the text sometimes shows and other times does not. When it does show the horizontal option is greyed out. How is this done?
    Thanks.

    With the Move Tool selected and no Selection active it should be no problem, could you please post a screenshot with the pertinent Panels visible?

  • Resizing panels inside of panels inside of panels...

    I'm trying to organize a GUI by using a series of panels inside a JFrame. I have added panels within these panels to organize my information since I've never been able to figure out that ghastly GridBagLayout. Anyway, I've hit a wall. It seems that I can't resize an object inside of a panel that's inside of a panel. I use the setPrefferedSize method, but it just doesn't have any effect. This is true for both panels and buttons. Am I right in my assumption that there's a limit to how far into a pile of panels one can use the setPrefferedSize method? I'm using primarily BoxLayouts if that makes any difference. Any help or suggestions or advice would be appreciated.

    I'm afraid the SwingUtilities.updateComponentTreeUI didn't work. When I say I'm a novice, I'm afraid I'm kind of shooting in the dark as to some solutions and problems. Let me try and clarify my problem a little bit with an example. I have JPanels A, B, C, D, E, F, G and JCheckBoxes 1, 2, 3. JPanel A is added to the JFrame. The rest go as follows:
    A.add(B);
    B.add(C);
    C.add(D);
    C.add(E);
    D.add(F);
    D.add(G);
    G.add(1);
    G.add(2);
    G.add(3);
    Every JPanel has used the .setPreferredSize() method to define the size I desire. JPanels A, B, C, D, and E all keep their preferred sizes. However, F and G mock me by resizing according to the sizes of JCheckBoxes 1, 2, and 3. Even though they are coded to take up a certain amount of space (which is well within the limits of JPanel D), they don't. Instead they just go to the default size, which is to allow all components within it to be visible. I have this same problem when I add other components into JPanels D and E, like buttons, other JPanels, etc. I hope this clarified more than it confused.

  • I've created new User account on my PC for separate itunes library/account. Have had to change apple id to do this. When I connect to pc, itunes opens with CDs I've already loaded, but it doesn't recognise ipod. No left panel opens with devices. Help!

    Can anyone help? Two ipods with originally one itunes library and (I think) same Apple id). Now need 2 Libraries with separate account for separate buying etc. Recommended I create new library on separate PC User account which I have done together with new apple id. I have added this apple id to the ipod needing separate account. When I hook up, I can't sync. No 'Devices' left panel appears at all. I'm at a loss here so any help woudl be great. Thanks.

    If you  have iTunes 11 turn on the Sidebar. Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar. The sidebar is where Devices appears. and Control+B to show the Menu bar
    If necessary:
    iOS: Device not recognized in iTunes for Windows
    or
    iOS: Device not recognized in iTunes for Mac OS X

  • How do I get network drives to show in left panel of media browser

    Okay, I'm new to audition.  When I start Audition's media browser, only the local HDD's are shown.  If I OPEN FILE, I can navigate to find tyhe network drive and Audition will open the file.  Also the network drives show in Windows Explorer.  I searched the FAQs and the help file, but maybe I'm not using the "magic words"  So, how to I get these network drives to appear?
    Windows 7 64 bit home premium
    home built 3.67 gb Intel Quad core, 12 GB RAM, Several local HDDs
    Audition CS6
    Thank you

    I'm not sure this is correct.  I have mapped a NAS to drive "Z" and mapped a drive on my video editing desktop to drive "Y."  These both show up in the left panel of the media browser for Premiere and Photoshop as the share names  "MYDOCS" and "BAAAA,"  as well as in Windows Explorer.  But not in Audition. Only the local drives are shown in Audition's media browser.
    I can open a file in audition by using BROWSE by clicking on "MYDOCS" or "BAAAA" as they appear in the Windows Explorer file dialong and then navigating on those drives to the desired files.
    What am I missing?  Do others have their network drives show in the left panel of Audition's media browser?

  • How do I expand the left panel to see more of my folder names?

    Or (alternatively), how do I hide (but not delete) upper-level folders so that my folder names don't get cut off? Here's a screen shot:

    gatorjim2000 wrote:
    In a word or two, you can't. You can drag the border between the left panel and the viewing area to enlarge the panel, but it only goes so far.
    That's not quite true.
    You can use Jeffrey's tool to expand the maximum width of the panels, and use narrower fonts if you want:
    http://regex.info/Lightroom/Config/

  • Problems with images greyed out. Downloaded folder not showing up in Left Panel

    Downloaded folder and it showed up in Lightroom. Next day images greyed out Folder doesnt show in Left Panel. Lightroom says no images to Import. What do I do?

    Mirrors_Winter wrote:
    Thanks so much dj for your response. Unfortunately I did start in the Library module and the folder wasn't there to click on. It was really strange, but the usual 'Previous Import' link wasn't showing anything! That's why I tried to reimport.
    If the folder doesn't show in your Library module, then you probably (accidentally) imported the photos using the MOVE option instead of the ADD option. You have to search for the desired photos by file name, and NOT by folder. Perform all of the following 4 steps, and you will find your photos
    Go to the Catalog Panel on the left in the Library Module and click on All Photographs
    Turn off all filters (Ctrl/Cmd-L once or twice)
    Expand all Stacks (Photo->Stacking->Expand All Stacks)
    Search by file name

  • Copy and paste - Restricted KF - Left panel

    Hello All,
    This is quite a silly question, in BI7 I cannot copy and paste a restricted KF in the left panel.
    Options are there but it's not working.
    Is this another bug in BI7 ?
    Thanks
    C.

    Hi,
    check this thread:
    BI Query Designer - Copy and Paste
    Hope this helps.........
    Rgs,
    I.R.K
    Edited by: Ravikanth Indurthi on Jul 31, 2008 6:37 PM

Maybe you are looking for