How to activate left alignment with Jpanels??

Hello
Please what is wrong. I cannot get left alignment activated. Otherwise panel appear nicely on screen. Here are the main parts of code:
public void addComponentToPane(Container allComponents) throws IOException {
allComponents.setLayout(new BoxLayout(allComponents, BoxLayout.PAGE_AXIS));
   panel_introduction.setAlignmentX(JPanel.LEFT_ALIGNMENT);
allComponents.add(panel_introduction);
   allComponents.setVisible(true);
}Edited by: wonderful123 on Oct 14, 2007 10:26 AM

Alignment in a BoxLayout can be more complicated than it appears. Posting 4 lines of code does not give us enough information.
So read the Swing tutorial on "How to Use Box Layout" for an explanation and examples of how alignment in a Box Layout works.
If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)",
see http://homepage1.nifty.com/algafield/sscce.html,
that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
Don't forget to use the "Code Formatting Tags",
see http://forum.java.sun.com/help.jspa?sec=formatting,
so the posted code retains its original formatting.

Similar Messages

  • Hi there, can anyone tell me how to activate my iphone with 2g network?

    hi there, can anyone tell me how to activate my iphone with 2g network?

    hi buddy, thnks for coming out to help me. so here we go.
    im using a vodafone connection and i made a dupilcate of that connection and made a nanao sim the will suit in iphone.
    after inserting its showing "To activate iphone"
    and below that 2 buttons are given as
    Try using Wi-Fi
    Try again over cellular
    and i dont have a wifi connection.
    but i have 2g connection in my number.
    on the top of iphone there is an "E" beside the range bars. obvioulsy might be Edge.
    When im selecting Try again over cellular then its showing could not activate.:(

  • How to activate ipod touch with no apple id

    how to activate ipad touch with no apple id &password i don't have proof of purchase

    Can't be done. You need an internet connection to activate an iPod after restoring.
    If your restore via wifi (settings>General>Reset>Erase all setting and connect) yo either need to connect to the internert via wifi or connect to a coputer and setup via iTunes. The computer requires an internet connection
    - If you restore via iTunes
    iTunes: Restoring iOS software
    The computer needs an internet connection

  • How to activate iPad air with t-mobile

    how to activate iPad air with t-mobile service

    Contact t-mobile where you are. Probably easiest to go to one of their
    stores or kiosks to sign up for a data plan and get an appropriately sized
    sim.

  • How can I Left Align text in the Marker Arrangement tabs?

    It would make it easier to read the heading text of the Arrangement Marker tabs if they were Left Aligned when the project is minimised.
    Is there any way of setting this up or is it a default?

    I'm not aware of a way to make Firefox hide the first tab instead of the last tab; maybe there is an add-on with that feature.
    There is a hidden setting to open the new tab at the end of the bar instead of next to the page you're reading. Then, of course, you won't have this problem. Instead, you'll have the problem that it's hard to figure out which tab had that link in it. In case you want to try it out, here's how.
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''tabs''' and pause while the list is filtered
    (3) Double-click the '''browser.tabs.insertRelatedAfterCurrent''' preference to switch it from true to false (it should turn bold)
    You're done here. You can keep it open in case you hate the change and watch to switch it right back. In that case, double-click again to switch it back to true.

  • How do you not align with the biggest bounding box?

    This is driving me up the wall, I know a way around it, but at some point later in this project the work around won't be efficient enough.
    Ok here is the problem, I have four objects that are going to be large oversized buttons on a website. Inside these buttons (which are square) I have placed a picture, as the picture is larger than the button area I have duplicated the button box and made it a clipping mask for the picture. I have aligned it all up and grouped everything for one button together as one big group. I have done this for each button, so now all buttons are made up of a group of objects.
    The problem is because these images are too big for the buttons and I have clipped them there bounding box is bigger than the buttons so when I come to align them or distribute them it all goes wrong. Why? Well the distribution/alignment goes on the combined area bounding box, in this case the pictures are much bigger so it's pretty much there bounding boxes that everything is getting aligned with. In InDesign it treats the bounding boxes of objects within a clipping mask as being the size of the clipping mask, which is exactly what I want to do here. This seems a massive limitation and I can't see why I would ever want to distribute or align with something that I am effectivly removing from the document.
    The work around is quite simple, I can take everything out of the button boxes, align the button boxes and then put everything back in the button boxes. This would be acceptable if I only had to do it once, but if (and I probably will) want to tweak the layout as I go it's going to be a pain in the rear.
    Any ideas?

    I could pre-crop the images in PS but then I loose the ease of changing them in Illustrator. I always try and do as much work as possible in Illustrator so I am able to undo or change things quickly, I am not a big fan of the finality of working with raster images.
    The real issue is that the client is comming to look at some mockups and if they ask for changes, which we usually do there and then, we will look a bit silly as we complete destruct and then re-construct each object.
    If those align scripts work how I am thinking I might make 4 place holder graphics (that I switch off when I am finished) and centre align each button to those with the scripts.
    Illustrator should just be have an option to align the visable layers or items only. I would even accept the ability that when you switch off a layer in a group (say these pictures where there bounding box goes beyond that of the clipping mask) so your only active layer is a box the same size as your clipping mask and so that is the only bounding box that gets used, but no the off layers still have active bounding boxes.
    Regards
    Paul

  • How to activate a JButton with right-click?

    If I create a JButton and add an ActionListener, I can activate the button with a mouse left-click but not with a mouse right-click.
    I've looked at other posts related to this topic. Some people have said that the default is that either a left- or right-click will activate a JButton but I can't get this to happen.
    If I add a MouseListener to the button, I get mouse events for both left and right clicks (in mousePressed() for instance) but only the left-click goes on to activate the JButton.
    I'm using Java 1.4 with Windows 2000.
    Thanks in advance for any help.
    -Rick

    I use Windows 98, that's what I get too. I'm pretty sure that's normal behavior. If you want right clicks to be processed as well, use this code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class BothClick extends JFrame implements MouseListener
        JButton clickMe;
        public BothClick()
            super("Test");
            setSize(300, 300);
            clickMe = new JButton("Click Me");
            getContentPane().setLayout(new FlowLayout());
            getContentPane().add(clickMe);
            clickMe.addMouseListener(this);
            setVisible(true);
        public void mousePressed(MouseEvent e)
            clickMe.doClick();
        public void mouseReleased(MouseEvent e) {}
        public void mouseEntered(MouseEvent e) {}
        public void mouseExited(MouseEvent e) {}
        public void mouseClicked(MouseEvent e) {}
        public static void main(String[] args)
            new BothClick();
    }

  • How to activate a valve with a switch ?

    I am going to work on the automation of a miniature punch press using compressed air and also a pneumatic valve, I was wondering how I would be able to activate this mechanism with a switch?
    Also, what would be the best method to activate this set up ?

    Can you provide more information about the valve itself?  For example, is it expecting an analog signal or a digital signal?  If this is an analog setup, the valve would probably expect a DC value that represents a certain pressure.  You would need a variable voltage source (a DAQ card for example) to provide the appropriate signal to the valve.  A switch would most likely not be necessary.  If the valve is expecting a digital signal, then you will need a DC power supply set to the digital high voltage (5V for example) and then use the switch to regulate the state of signal.
    Brian R.
    District Sales Manager
    Washington DC
    National Instruments

  • HT4865 How to activate my phone with the apple id

    how to activate my phone without the apple id

    I know it's the right apple i.d. and the password is right because I can get into icloud on the computer.

  • HT204053 HOW TO ACTIVATE ICLOUD LOCK WITH CHANGED PASSWORD AFTER RECOVERY

    i have lost my iphone5 9 moths ago. recently i find my ihone5 but it is stucked in icloud lock mood. now a days i use that same icloud account for another iphone4s and i have changed the icloud password. i have changed the icloud password 2 month ago. i have also lost access in my hotmail account. in this case can i activate my iphone5 with current password or i have to get access to my email adddress. or what can i do now?

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    Providing you are simply updating your existing details and not changing to another account, when you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again.
    In order to change your Apple ID or password for your iCloud account on your computer, you need to sign out of the account from your computer first, then sign back in using your updated details. (System Preferences > iCloud, click the sign out button)
    In order to change your Apple ID or password for your iTunes account on your iOS device, you need to sign out from your iOS device first, then sign back in using your updated details. (Settings > iTunes & App store, scroll down and tap your ID)
    If you are using iMessages or FaceTime, you will also need to log out and into your ID there too.

  • How to activate iphone 3gs with iOs 6.1

    iphone 3gs upgraded to ios 6.1 deactivated. how to activate? help pls.

    Probably you can't due to hacking or jailbreaking your iPhone.
    If not try this
    IOS: Resolving iPhone activation messages
    http://support.apple.com/kb/TS4242

  • How to Center Left-Aligned Site?

    I have a web-site -- 100+ pages -- that's aligned to the left
    of the browser window, leaving the right part blank. Is there some
    code I could put into existing templates that control the site's
    pages that will cause all the pages to center, like on this Adobe
    site?
    Thank you.

    It would depend entirely on how the site's pages are built.
    But you could
    try this -
    Change this -
    </head>
    to this -
    <style type="text/css">
    <!--
    body { text-align:center; }
    #wrapper { text-align:left; width:760px; margin:0
    auto;position:relative; }
    /* 760px is a width that fits 800px screens with maximized
    browser viewports
    without horizontal scrollbars - change it to suit */
    -->
    </style>
    </head>
    change this -
    <body ...>
    to this -
    <body ...>
    <div id="wrapper">
    and this -
    </body>
    to this -
    </div><!-- /wrapper -->
    </body>
    and see if that helps.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "PAB1953" <[email protected]> wrote in
    message
    news:eaa86q$e8s$[email protected]..
    >I have a web-site -- 100+ pages -- that's aligned to the
    left of the
    >browser
    > window, leaving the right part blank. Is there some code
    I could put into
    > existing templates that control the site's pages that
    will cause all the
    > pages
    > to center, like on this Adobe site?
    >
    > Thank you.
    >

  • How to Activate Datastore loaded with Transformation.

    Hi Gurus!
    When I used update rules and infopackages to load an ODS (with activate data  flagged) loaded records were automatically activated.
    Now I'm starting to use transformations and when I load data to Datastores I have to manually activate loaded data.
    Is there any way to activate automatically loaded data??
    I found how to do it for cubes but not for Datastore objects...
    Thank you.

    No u cannot activate automatically on Netweaver 7.0 excepting only in Process Chains.
    <b>Check out the below note</b>
    Note 946572 - "Activate data automatically" option without result.
    Symptom
    While working with a DataStore object, you have activated the option "Activate data automatically". However, after a request is successfully loaded, the activation does not start automatically.
    Reason and Prerequisites
    The program logic has been changed.
    In the case of NW2004s, the "Data Transfer Process" (DTP) was introduced as a new technology for loading data. Requests that were loaded via a DTP to a DataStore object are no longer automatically activated.
    Solution
    Use process chains to automate data activation.

  • How to activate iphone 4 with icloud

    i dont have a sim card to activate phone, but i remember i activated my iphone last time with icloud but i forgot how to

    No you cannot.
    Even if you could activate an iPhone for cellular service with an email account, which is one of the dumbest things I have read here in a while and dumb statements are a dime a dozen around here, you darn sure can't activate a GSM phone without a SIM card.
    Cellular activation with an iPhone DOES NOT and CANNOT occur with an iCloud account or with any email account.

  • How to apply left align Syle for the panelLabelAndMessage components in ADF

    HI All,
    Using jdev version 1.6.
    There is one FormGroupLayout and undrthat many panelLabelAndMessage components and each panelLabelAndMessage having different types components like textbox,dropdown etc .
    Here question is how to make llabel as eft aligh for the all components of panelLabelAndMessage .
    text-align:left is not working for the components under the panelLabelAndMessage .
    i have tried by hardcoding the lable align text align as Left ,its working .But if we apply from the CSS class its not working .
    syntax fallowed
    <af:panelGroupLayout id="pgl1">
    <af:panelFormLayout id="pfl1">
    <af:panelLabelAndMessage id="plam8" styleClass="panelLableClas">
    <af:inputText value="xyzzz" label="employee" id="it68"/>
    </af:panelLabelAndMessage>
    <af:panelLabelAndMessage id="plam9" styleClass="panelLableClas">
    <af:inputText value="adbcs" label="depetmantname" id="tg"/>
    </af:panelLabelAndMessage>
    </af:panelFormLayout>
    Styless class syntax used:
    .panelLableClas{
    text-align:left;
    Thanks

    Hi,
    this is where skinning serves you better
    af|panelLabelAndMessage::label{
    text-align:left;
    Read up on skinning: http://docs.oracle.com/cd/E23943_01/web.1111/b31973/af_skin.htm#BAJFEFCJ
    Frank

Maybe you are looking for