How can I align a JMenuBar at right ?

Hello,
the question is very simple : How can I align a JMenuBar at right ?

So can you try this ?
import javax.swing.*;
public class MenuBarDroite extends JFrame
public MenuBarDroite()
super();
setSize(400,300);
JMenuBar menu = new JMenuBar();
menu.add(Box.createHorizontalGlue());
JMenuItem menuItem1 = new JMenuItem("");
JMenuItem menuItem2 = new JMenuItem("Menu 2");
JMenuItem menuItem3 = new JMenuItem("Menu 3");
JMenuItem menuItem4 = new JMenuItem("Menu 4");
menu.add(menuItem1);
menu.add(menuItem2);
menu.add(menuItem3);
menu.add(menuItem4);
setJMenuBar(menu);
public static void main(String argv[]) throws Exception
MenuBarDroite m = new MenuBarDroite();
m.setVisible(true);

Similar Messages

  • How can I align text in Acrobat 8.1 Professional?

    Okay this is quite silly, but seriously how can I align text in adobe acrobat? I could not find a way other than creating a new document file which allows me to use alignment options automatically (example below), however does not allow me that when I reopen the same file (alignment and text options just dissapear on the bars, funny). Help anyone please? =/
    http://img152.imageshack.us/my.php?image=examplemo2.jpg

    Not that silly; but you ideally shouldn't be trying. Although there are some rudimentary (and sometimes unpredictable) editing tools in Acrobat, (I presume you are trying with the TouchUp Object tool as well as the TouchUp Text ?) much better to get it right in the source application and think of the pdf as what it basically is...a print.
    For whatever reason, v5 could edit text positioning rather more easily than the later versions.

  • Downloaded iTunes 11.0.2.26,the print CD jewel case does not print right,all the songs listed are printed in about a 1/2in. space,how can I get it to print right

    Downloaded iTunes 11.0.2.26,the print CD jewel case does not print right,all the songs listed are printed in about a 1/2in. space,how can I get it to print right

    I recently upgraded to itunes 11.0.1.12 and that fixed the CD Jewel Case Insert song titles problem. Thanks itunes. It's working great!!.

  • How can i display at  JTextArea from right to left

    how can i display at JTextArea from right to left?
    i try to write setAlignmentX(JTextArea.RIGHT_ALIGNMENT)
    but this not help,
    thanks for help.

    use this
    JTextArea.applyComponentOrientation(java.awt.ComponentOrientation.RIGHT_TO_LEFT);

  • I hit the wrong monitor refresh rate and now lost monitor picture.  How can I get back to the right refresh rate with no pic to view?

    I hit the wrong monitor refresh rate and now lost monitor picture.  How can I get back to the right refresh rate with no pic to view?

    Try this:
    Mac OS X 10.6 Help: If you changed your display’s resolution and now it doesn’t display a picture

  • How can I align multiple titles in Premiere Pro?

    We are working on a video (obviously) and we have a bullet list that we'd like to come up as the speaker is naming off specific items. So far we have created a separate title for each bullet point, so that we can control when the bullets fade in. The issue we're having is that we have to eyeball the alignment right now and it's not always accurate. So i'm looking for some help. How can I select multiple titles in the timeline and right align them - OR - is there a way to have all of these bullet points in one title and still maintain control of when they fade in and out?

    This technique will only work with current versions of PPro - it looks harder to do than it actually is:
    Create the title with all the bullet points, aligned as you wish, in the Title Tool.
    Exit the title tool, the title you just created will appear in your project.
    Click on the title to select it (if it is not already selected) and then go to the menu Edit > Duplicate.
    Repeat the duplication process to make as many copies as number of bullet points you want to transition on.
    Place the first copy of the title where you want the Title to appear in your video.
    Double click on the clip of the title on the timeline to re-open the Title Tool. Delete all the text except the first line.
    Now place the second copy where you want it to appear in the video.
    Double click on it to re-enter the Title Tool, and delete all the text except the first two lines.
    Repeat this process for as many bullet points as you have, delating one fewer bullet point each time. You can add transitions at the cut points between the titles (such as a dissolve) to make the next bullet point appear as you wish.
    If you try to to this using an early version of PPro this will not work as the titles and its copies are linked - so if you change one of the copies, it changes all the other titles. Fortunately this has been fixed in the current version.
    MtD

  • How can I align mask with object in Y axis?

    Hi
    Can anybody help me? I want to put small band on the upper arm of man in the scene, he is walking from right to left, I put my image in upper layer and made rectangle band and animated it with his arm but the problem is that I cant align the band with arm in Y axis, because of that there are some small tremors in the band, how can I define exact point on the arm and align my mask with it?
    Appreciate any help in advance

    ^ Yep, Mylenium is right. There are two ways to do things - the easy way and the hard way. The easy way always involves thinking things through and establishing what you want before you shoot. Can you shoot with the band in place? If not, can you add tracking markers to the arm to facilitate adding the band later?
    The hard way occurs when you have no choice and the work has to be done after the shoot. And Mylenium is dead right - before computers, EVERYTHING was done by hand, manually checking frame by frame until animations were correct. If your footage does not have the adequate preparation or detail for a computer to track, and you're unable to reshoot, the only option is to animate manually, check, fix, re-check, fix etc.
    The Motion Tracking Workflow section of the manual is an excellent introduction:
    http://livedocs.adobe.com/en_US/AfterEffects/8.0/index.html

  • How can I slide detached audio left/right in sample increments, rather than frame increments?

    I exported a detached audio file from FCP X to Pro Tools for processing, and I have now imported the processed audio file back into FCP X.
    I need to align the processed audio clip with the original audio clip. I am using View --> Zoom to Samples, and can see the amount I need to slide/nudge the processed clip in the Timeline. The problem is that the mis-alignment is smaller than a frame. This sounds small, but it is visually clear when you play the video/audio that the video and audio are not aligned.
    Question:
    How can I elect to slide the audio left/right in the timeline in increments of the audio samples, rather than in increments of video frames?
    Since FCP X allows you to view the audio in Samples, it certainly must somehow let you slide/nudge the audio in Samples........I just haven't found it. 

    Let's be clear about one thing. There is no way on earth any human being can percieve a one frame discrepancy in sync at a frame rate of 24fps or higher. Going to increments smaller than one frame, while it can be done, makes no difference to the way the media is viewed. Presumably your viewer will not have the benefit of multiple synced waveforms as a guide.
    It sounds like you have an alignment problem in ProTools. This should be a incredibly simple to fix in that application.
    The problem may laos be one of sample rate difference. What are the specs of your export audio file from FCP and the specs of your imported replacement file coming from ProTools. They should line up exactly if the sample rates are identical.

  • How can I view page info without right-clicking?

    Hi, I've recently updated to Firefox 4.0.1, and with the "tools" menu gone, I can't find out how to view page info anymore without right-clicking. This can be a problem for sites in which right-click is disabled. I have also tried ctrl+I, but this only opens the bookmarks menu. Is there a way of viewing page info in the new Firefox without right-clicking?

    *Page Info Button: https://addons.mozilla.org/firefox/addon/page-info-button/

  • How can I give an user the right to change passwords

    I'm still absolute server beginner, so I have to ask here.
    How can I give users the right to change passwords or to view calendars?
    I didn't find it, yet.
    I've found an option to change rights, when I click on the user with two fingers (right mouse button). But all options in this menue are grey.

    Hi Holger,
    These are two fundamentally different issues. I'll try to address them each. For both you will need to have OpenDirectory set up (see the Users Next Steps list in the Server app). Once that is done. Additionally you will need the Server Admin Tools 10.7. Once you have them installed, you can specify the OpenDirectory password requirements for users
    User Passwords in OpenDirectory
    On the server, open Server Admin app.
    Connect to you server, then click on the OpenDirectory service.
    Click on the Settings icon.
    Click on the Policies tab.
    Click on the Passwords sub-tab, and you can set all the criteria for password requirements here.
    Resetting Passwords
    Users must log in as network users on the client computer.
    Once logged in, to change the password, open System Preferences.
    Click on Users & Groups.
    The user icon will be a silhouette with stars in the background. This means it is a network user. Click on the Password tab at the top.
    Click the Change Password ... button to change the password.
    Calendars in iCal are much like RSS feeds: users need to subscribe to them, like we discussed in our other posting. Network users will automatically be given a network iCal calendar, and will be automatically subscribed to it. However, if you want to automatically add subscribed calendars to network user's accounts, you will need to use ProfileManager.
    On the server, open Server app.
    Click on the Profile Manager menu item.
    Make sure that iCal service is running (green indicator next to it). Click on the "Include configuration for services: ...". Make sure the iCal icon is listed there.
    Click the "Sign configuration profiles" checkbox.
    Turn Profile Manager on.
    Once Profile Manager has loaded (the gear at the bottom right will no longer be spinning), go ahead and click the Open Profile Manager link.
    Log into Profile Manager as your directory admin user.
    Click on the Groups menu item to give all users of a specific group access to the wiki calendar. This is best if you have a wiki for a group and want to share that calendar. Use the Everyone group to add this calendar for all users.
    Click on Users to give access to only specific users.
    Edit the profile for the group(s) or user(s) you selected by highlighting that group and clicking the edit button.
    Scroll down and select the CalDav item on the left.
    Click configure. Here you will need to enter the specific details for that callendar based on the subscription details you get when subscribing to the calendar via the wiki.
    After all that you still need to configure each client computer to be set up for profile management, which really is a topic of its own. I recommend the following tutorials:
    Installing OS X Lion Server
    OS X Lion Server Administration Tool Tour
    Setting Up Profile Manager on OS X Lion Server
    Using Profile Manager on OS X Lion Server
    Hope this helps, good luck!
    ~Mike

  • How can I set Java class path right?

    After I downloaded Java Developer for 10.6 (10M3239a) (Disk Image) 139.4 MB,
    when I opened eclipse it showed 2 errors
    The project cannot be built until path errors are resolved
    Unbound classpath container: 'JRE System Library [Java-1.7]'
    how can i resolve this problem.
    can someone please help me, i am really new to these stuffs.

    I have the exact same problem. I'll try to find out but if someone could help us it would be grate.
    In my error message it says:
    The project cannot be built until path errors are resolved
    Unbound classpath container: 'JRE System Library [JavaSE-1.6]

  • How can I align a character exactly flush with the right side of a text box?

    I'd like to automatically align some text so it touches the right side of its text box exactly for all characters ("Optical Margin Alignment" doesn't work). Figure-1 shows the default behavior for right-aligned text. Figure-2 shows what I want it to look like. Since these characters are inputs from a large Data Merge, manually adjusting each instance is not a practical solution.
    Selecting the "Align Left Edge" checkbox in "Drop Caps and Nested Styles" is exactly the kind of behavior I'm looking for, except it needs to be the "Right Edge" not the "Left Edge".
         Figure-1: This is the default behavior for right-aligned text.
         Figure-2: The is what I want the result to look like.

    Rob, thanks for the link with the thread. At least I know I'm not missing some obvious function somewhere.
    Olfar, I follow what you did with "Indent to Here" and the Hair Space, and I understand how to use tracking to manually align the second line, but I don't know much about grep styles, so I didn't follow that part. Does the technique you used work for all characters? For instance, if you replaced the "1" with a "7", would it automatically align the rightmost part of the "7" with the "N"? Also, I need something that works with double digit numbers, and I don't think the Hair-Space-and-Tracking trick is going to work in those cases, but I could be wrong.
    Thanks.

  • How can I sync and use iCloud right (when I've been doing it wrong)

    First off I have to burnish my pride a bit by saying that I've been using Macs since 1988 and I'm a developer and UI designer and know all the geeky stuff and all the gadgets and blah blah. 
    Now that that's out of the way, I only got into using iTunes with another device when I got my iPad back in 2010.  I never had an iPod before.  I used to buy songs through iTunes, stored my ripped music from CDs (and even a few songs through P2P networks I admit) all in iTunes.  I always treated the music like other data and just backed it up on drives and never really made a concerted effort to sync anything to anything.  I occasionally used 3rd party s-ware like Xilisoft to manage copying files back to my hard drive.  I'm also a big fan of TidyUp (www.hyperbolicsoftware.com) to remove duplicate files and all that.  My backup procedure is, sorry to say, just buy another drive and keep swapping data.  I'm sorry...I suck. 
    Then I got an iPhone early this year and started another combination of apps and media that never quite synced up with my hard drive.  When iCloud came along, I updated my iPhone and learned that it took all my apps and media off b/c I never synced that up properly.  I eventually got the media and apps back onto my iPhone through iCloud.  I see how the syncing thing can be a really wonderful method...when done correctly, esp. w/iCloud.
    But now the desktop has only the apps & music from my iPhone (i think).  I'm about to update my iPad to iOS 5 and have a bunch of questions:
    When it says "There are purchased items on the iPad “_____” that have not been transferred to your iTunes library. You should transfer these items to your iTunes library before updating this iPad. Are you sure you want to continue?" I cancel.  But if I go to Purchased from the iPad and drag them to the Library, when I go back to update, it gives me the same message. 
    Is there a way, I guess 3rd party, to get apps from the iPad to the desktop?
    I see books on my ipad, but not the same books that I purchases through Kindle or Google books, just some (not all) of the books in my iBooks.
    Is there any way to designate through iTunes what songs were purchased and what were imported from previous CDs?  Yeah, I can count on iCloud and my other drives to locate all the music, but it would be great to see this displayed in advance. 

    went to the apple store and got a little more detail.  he said to first backup the iPad (right-click on it in iTunes). then 'restore' the iPad.  THEN update.  I downloaded the update software, so now my option is "restore & update" which i'm doing now. 
    I still don't get how you can look in iTunes at a device's apps in the Library view and see apps from my iPhone, but it doesn't show me the apps for the iPad. What I see there are the apps from my iPhone.  I only see iPad's apps when I look at that device in iTunes>Summary.  The rep had no idea why there was not the complete listing of books on iTunes as there was on the iPad. 
    Thanks....

  • How can i place button on top right hand corner of the tabbed pane

    Hi all,
    i want to place button on top right hand corner of the tabbed pane, just run the code below, i have add button(it going to insert tab into tabbedpane), i want to place that tab into top right hand corner of the tabbedpane (not inside the tab itself). if i set tab policy setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT), it will give two button at right hand corner along with those buttons i want to and one more add button.
    please suggest so that i can move forward.
    Thanks in advance
    import java.awt.Dimension;
    import java.util.HashMap;
    import javax.swing.JPanel;
    import javax.swing.JTabbedPane;
    * @author  Dayananda.BV
    public class TabpaneDemo extends javax.swing.JFrame {
        /** Creates new form TabpaneDemo */
        HashMap<Integer, tabpanel> panelMap = new HashMap<Integer, tabpanel>();
        public TabpaneDemo() {
            initComponents();
            createFloorPlan();
            getContentPane().setPreferredSize(new Dimension(400,400));
            jTabbedPane1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            jTabbedPane1 = new javax.swing.JTabbedPane();
            add_tab_button = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            add_tab_button.setText("+");
            add_tab_button.setMargin(new java.awt.Insets(0, 0, 0, 0));
            add_tab_button.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    add_tab_buttonActionPerformed(evt);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(308, Short.MAX_VALUE)
                    .addComponent(add_tab_button, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(67, 67, 67))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(add_tab_button)
                    .addGap(8, 8, 8)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE))
            pack();
        }// </editor-fold>                       
        private void createFloorPlan(){
            tabpanel floorplan_Panel = new tabpanel(panelMap.size()+1);
            panelMap.put(floorplan_Panel.getTabIndex(), floorplan_Panel);
            jTabbedPane1.add(floorplan_Panel, floorplan_Panel.getTabName());
            jTabbedPane1.setSelectedIndex(jTabbedPane1.getTabCount()-1);
        private void add_tab_buttonActionPerformed(java.awt.event.ActionEvent evt) {                                              
            createFloorPlan();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new TabpaneDemo().setVisible(true);
        // Variables declaration - do not modify                    
        private javax.swing.JButton add_tab_button;
        private javax.swing.JTabbedPane jTabbedPane1;
        // End of variables declaration                  
        class tabpanel extends JPanel{
            private int tabIndex = 0;
            private String tabName ;
            public tabpanel(int tabIndex) {
                this.tabIndex = tabIndex;
                if(tabIndex >= 10) {
                    tabName = "Floor Map"+tabIndex;
                } else{
                    tabName = "Floor Map"+tabIndex+"  ";
            public int getTabIndex(){
                return tabIndex;
            public String getTabName(){
                return tabName;
    }Thanks
    Dayananda B V

    This part of tabbed pane is not customizable as it lies in the ComponentUI(TabbedpaneUI) portion of the tabbedpane.
    But I can point out the place u can change to bring the desired feature into effect.
    U can find an Inner class called ScrollableTabSupport
    Look for the methods createButtons where u can create extra buttons and add to the tabbed pane.
    The Inner class also implements actionListener where u can implement the action for the button u added.
    By this method U have to use your own extended TabbedPaneUI which u cant escape from.
    Hope this will help u.

  • How can I align a text object by the visible text and NOT by its bounding box?

    Illustrator CS4.
    I am trying to align some text to the center of the artboard. The bounding box is bigger than the text, so when I try to align it to the artboard it doesn't actually center align the artwork as I need it to. The text is needing to be aligned with another text object, so I can't just center align the text and then align to the artboard (which would eliminate the bounding box problem, I think). To make matters worse, the text I want to align has a stroke.
    The only way I know to currently align the text properly is to convert it to outlines. This is what I've done, but I need something better. I want to be able to have my illustrator file that has all editable text and then be able to make a separate identical file with all text converted to outlined paths. The only thing holding me back right now is that I can't get the exact alignment while everything is still as text.

    The solution is to simple to believe and probably why you over looked it.
    You make two text frames to exactly the height and width of the text. You position the text in the relative location and then group the text frames  then center that group on the artboard.
    Like such:
    If you ever want to add text that should be no problem but you have to re center.

Maybe you are looking for

  • How to add a PDF document in my website

    As the title said, i have a website [link removed by moderator] , recently i need to put a PDF document to list all of my products , my website is develpped by using the framwork wordpress, which method could i use to put my document pdf dans le webp

  • Blank fields in adobe reader

    Using a Mac and filled in the adobe reader boxes of text from Boy Scouts of America, filling out eagle project form.  When I open the file it appears to be empty but when I click on each field the text is there, only one box at a time can be viewed w

  • Iphone crashes after phone call

    My iphone 3gs will crash immediately after completing a phone call. I don't even hit "end call". Crashes as my lower the iphone from my ear. Need to do a reset each time. Any suggestions?

  • Regarding Invoice ( MIRO ) item info.

    Hi all, Can anyone tell me in which table MIRO line item will be maintained? Actually i wanna pickup POTEXT field from MIRO transaction. Thx & Rgrds, Pawan

  • Recent usage update

    recent usage not been updated for 5 days.is there a problem? John