Problem in using bar ??

Hi to all friends here ,
i made a bar the i put on it some buttons and i put also comboBox but when i put comboBox the comboBox take all the space that rest in the bar ...
so i decide to put the comboBox on label then put the label on bar
but unfortuantly the label not appear ...
I want to know the correct way for codeing this ...
Here is my code:-
import java.awt.BorderLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuBar;
public class BarTest extends JFrame {
    private JMenuBar barIcon = new JMenuBar();
    private final JLabel labelsizeComboBox;
    private final JComboBox sizeComboBox;
    private final JButton[] buttons;
    private String[] images = {"new.JPG", "open.JPG", "save.JPG", "copy.JPG", "paste.JPG"};
    private String[] imageName = {"new", "open", "save", "copy", "paste"};
    private final ImageIcon[] imagicons;
    public BarTest() {
        barIcon = new JMenuBar();
        labelsizeComboBox = new JLabel();
        sizeComboBox = new JComboBox();
        for (int i = 6; i < 72; i += 4) {
            sizeComboBox.addItem(i);
        labelsizeComboBox.add(sizeComboBox);
        barIcon.add(labelsizeComboBox);
        buttons = new JButton[images.length];
        imagicons = new ImageIcon[images.length];
        for (int i = 0; i < images.length; ++i) {
            imagicons[i] = new ImageIcon(getClass().getResource(images));
buttons[i] = new JButton();
buttons[i].setIcon(imagicons[i]);
buttons[i].setText(imageName[i]);
buttons[i].setToolTipText(imageName[i]);
barIcon.add(buttons[i]);
getContentPane().add(barIcon, BorderLayout.NORTH);
public static void main(String[] args) {
BarTest bar = new BarTest();
bar.setDefaultCloseOperation(BarTest.EXIT_ON_CLOSE);
bar.setSize(500, 250);
bar.setVisible(true);
bar.setLocationRelativeTo(null);
thanks in advance...
Beshoy .A.W                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Hi
This is the final code we wrote it
    public BarTest() {
        barIcon = new JMenuBar();
        sizeComboBox = new JComboBox();
        for (int i = 6; i < 72; i += 4) {
            sizeComboBox.addItem(i);
        barIcon.add(Box.createHorizontalGlue());
        buttons = new JButton[images.length];
        imagicons = new ImageIcon[images.length];
        barIcon.add(Box.createHorizontalStrut(10));
        for (int i = 0; i < images.length; ++i) {
            imagicons[i] = new ImageIcon(getClass().getResource(images));
buttons[i] = new JButton();
buttons[i].setIcon(imagicons[i]);
buttons[i].setText(imageName[i]);
buttons[i].setToolTipText(imageName[i]);
buttonGroup.add(buttons[i]);
barIcon.add(buttons[i]);
barIcon.add(Box.createHorizontalGlue());
barIcon.add(Box.createHorizontalStrut(10));
barIcon.add(sizeComboBox);
barIcon.add(Box.createHorizontalGlue());
getContentPane().add(barIcon, BorderLayout.NORTH);
In this link you can download the output which appear, you will see :
The button new,open,copy.....etc in the center of bar and there is a space and then the comBobox  .
I want the buttons begin from the start of the bar
and then there is very very very small space then put comBobox
thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • I have problems when using the camera on my iPhone 4S (the same for my daughter with a iPhone4) A veil around the blurred photo, a development impossible and completely unable to read the bar code or QR code. What to do?

    I have problems when using the camera on my iPhone 4S (the same for my daughter with a iPhone4)
    A veil around the blurred photo, a development impossible and completely unable to read the bar code or QR code. What to do?

    Sounds kind of stupid, but check to make sure that your iphone case cover is not blocking the edge of the camera lens.  I had a silicone case on my 3S and when it got older, it started tot slip and the edges of my pictures were blurred.

  • The problem of using timer in long windows with scroll bar

    Hello everybody!
    There is a problem of using timer in windows with scrolling. Lies in the fact that at the moment of the trigger "when-timer-expired", is "jumping" on the active field in the form (where the cursor). If the user scrolls at this moment unscrewed to view another location below, or higher, then it will then "jump" from the viewing area.
    I tried to fix the problem by replacing the timer in Forms, a timer in the JavaBean.
    It did not help. At the moment of the trigger WHEN-CUSTOM-ITEM-EVENT of JavaBean, anyway there is a jump.
    I have not a few forms, but only one form. With one long window.
    I use Oracle Forms 10.1.2.3.
    The forum discussing this problem. But it has not been resolved, I think. It is also proposed to destroy and recreate the timer at the transition between the forms. But the form I have just one!
    Has anyone encountered this problem? What are the solutions?

    CraigB wrote:
    Could you explain the overall affect you are going for? Perhaps if we knew what you were trying to achieve we could offer potential solutions that don't involve using a Timer or perhaps a differnt way to use the Timer.
    Craig...No.
    In different tasks, different purpose of timer. Can I use the timer without jumps?

  • TS2570 doesn't work, still the same problem when using Rapidweaver software. NOT with other software.

    i tried everything in this article, but still have the same problem when using Rapidweaver software. NOT with other software. I am converting my iWeb site  to Rapidweaver, whenever there is a calmer period in my office. I have 16 Gb RAM on my NEW iMac and have Parallels desktop, mail, safari, iWeb and Rapidweaver running simultanious.
    I never have the problem if i don't use Rapidweaver, but after i have added several pages to Rapidweaver, the problem begins. my iMac won't start up. the only thing that works is re-installing Macos OS X 10.8. i tried even whiping the completeharddrive, and reinstalling with a complete new user, the same problem.
    I had it on my previous iMac also, and bought a new one because i thought the problem was in the iMac first. i hadn't noticed it only happens with using rapidweaver.
    i sent my complete rapidweaver project to the programmers from rapidweaver at Realmacsoftware, but they couldnt reproduce my problem, there macs started up without any problem.
    i deleted all the rapidweaver addons and extra stacks, and started a complete new project.
    saterday i had the problem again, after adding about 5 new pages to my rapidweaver site.
    i think i have reinstalled Macos OS X 10.8.2 20 or 30 times by now
    does anyone have a sollution?

    Type '''about:support''' in the URL bar and hit Enter.
    Scroll down almost to the bottom of that listing and see if you have '''user.js Preferences''' just above the '''''Graphics''''' category.
    If you do have that, click on '''user.js file''' in this sentence. <br />
    ''Your profile folder contains a user.js file, which includes preferences that were not created by Firefox.''
    Does that "different homepage" appear in that user.js file?

  • Ipad 3 charger problem im using the original charger and it say is not apropiet for device.this problem star today. :/

    ipad 3 charger problem im using the original charger and it say is not apropiet for device.this problem star today. :/

    Take it to an Apple Store for evaluation and possible replacement.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
     Cheers, Tom

  • I upgraded to Lion and then all video clips on for instance Youtube freeze every tenth second to buffer more data. I have a MacBook Pro and never had any problems when using Snow Leopard. Ulf Magnusson, Sweden

    I upgraded to Lion and then all video clips on for instance Youtube freeze every tenth second to buffer more data. I have a MacBook Pro and never had any problems when using Snow Leopard. Has Lion problems with this?
    Ulf, Sweden

    Use the trackpad to scroll, thats what it was designed for. The scroll bars automatically disappear when not being used and will appear if you scroll up or down using the trackpad.
    This is a user-to-user forum and most people will post on here if they have problems. You very rarely get people posting to say there update went smooth. The fact is the vast majority of Mountain Lion users will not be experiencing any major problems with the OS, or maybe with apps which are not compatible, but thats hardly Apple's fault if developers don't update their apps.

  • Problems in using Msync with  IPAQ 3760 and Active SYnc 3.5

    Hi,
    Environment :-
    IPAQ 3760
    Windows NT workstation
    Active Sync 3.5
    I am using Active Sync 3.5 which does not need RAS
    configuration on the machine.
    I am unable to run msync.exe. It does not give any errors
    messages.
    The 9i lite documentation talks about RAS settings.
    If anyone has faced similar prob coudl you please let me know
    the solution.
    regards,
    Sonal

    You do not need to make a RAS connection with Pocket PC 2002,
    because now ActiveSync itself makes an IP connection, and
    Oracle9i Lite just needs an IP connection for synchronization no
    matter how you establish it. Hi, I also experience the same problem. Using PocketPC 2002 I have a pasthru connection. Ik kan browse on the Internet with Internet Explorer, so the connections works.
    mSync just seems to do nothing. When I press the Sync button, nothing happens (not even a progress bar).
    Any idea?
    Thanks,
    Bas.

  • I am going to buy unlocked iphone 5.. i will be going to india nxt months and will stay there for a while... so my question is will i get warrenty in india.. and will there be any problem with using indian sims..?? thnx for the help..

    i am going to buy unlocked iphone 5.. i will be going to india nxt months and will stay there for a while... so my question is will i get warrenty in india.. and will there be any problem with using indian sims..?? thnx for the help..

    The warranty for the iPhone is not and has never been International.
    Warranty and support are ONLY valid in the country of origin.  The only exception is the EU where the entire EU is treated as one country.
    If the device will be used in India, buy it in India.
    An unlocked iPhone will work on any supported GSM carrier world wide.  The LTE portion of a US purchased, unlocked iPhone is unlikely to work outside North America as it does not support the appropriate bands used in other countries.

  • Problem on using Crystal Report Viewer on windows application ("specified type is not valid ")

    Hi
    I am having problem on using Crystal Report Viewer on one of my windows application.
    I am not sure how to put the Crystal Report Viewer 11 Control onto the tool box.
    I could found a Crystal Report Viewer control on my computer, but it is version 8.5.
    I have also found another one which is Called Crytal ActiveX Report Viewer, i don't think it is the one I can use. As when I try to load a dummy report on to the Crytal ActiveX Report Viewer, It return an error. "specified type is not valid"
    Please see the Code sample below.
    private sub loadReport()
         Dim r as New ReportDocument
         'v is the name of the Crystal ActiveX Report Viewer Control
         r.Load("C:\Report1.rtp")
         v.ReportSource(r) <---It throw error on this line.
    End Sub
    Could you give me some advice about what have I done wrong, How to check if I have set up the Crystal Report Component correctly in my Visual Studio 2005 Standard edition.
    Thanks in advances.
    Many thanks
    Chi

    VS 2005 Standard and Express editions do not come with Crystal Reports; only the Professional and higher editions will have CR bundled. However, I believe you can purchase CR XI R2 Developer and it will give you the components you need to create a VS .NET 2005 application using the Standard edition.
    -MJ

  • Problem in using FM SELECT_TEXT

    Hi friends,
    I have a problem in using fm SELECT_TEXT.
    Here I want to fetch Material PO text in Material master to my report.
    I just dont know in which field of table "it_thead" the actual text is available.\
    I tried debugging the program but was not successful.
    I have also tried using READ_TEXT but it gives an error if no Text exists.
        CALL FUNCTION 'SELECT_TEXT'
          EXPORTING
            client     = sy-mandt
            object     = 'MATERIAL'
            name       = wrk_matnr
            id         = 'BEST'
            language   = sy-langu
          TABLES
            selections = it_thead.
    How do i print the actual MAterial PO text in IT_THEAD ?
    hope u understand the question...please do let me know if any details are required from myside..

    Hi,
    My mistake.
    Check below sample code.
    PARAMETERS: po_matnr TYPE mara-matnr.
    DATA: i_lines TYPE STANDARD TABLE OF tline,
          wa_lines TYPE tline,
          l_matnr TYPE thead-tdname.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = po_matnr
    IMPORTING
       OUTPUT        = po_matnr
    MOVE po_matnr TO l_matnr.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
    *   CLIENT                        = SY-MANDT
        ID                            = 'BEST'
        LANGUAGE                      = sy-langu
        NAME                          = l_matnr              "Pass material with leading zeros
        OBJECT                        = 'MATERIAL'
    *   ARCHIVE_HANDLE                = 0
    *   LOCAL_CAT                     = ' '
    * IMPORTING
    *   HEADER                        =
      TABLES
        LINES                         = i_lines
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
       WRONG_ACCESS_TO_ARCHIVE       = 7
       OTHERS                        = 8
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT i_lines INTO wa_lines.
      WRITE: /1 wa_lines-tdline.
    ENDLOOP.
    Just execute this code by inputting ur material number.
    If the text doesnot exist the error u r getting because of not commenting the MESSAGE statement after FM call. Try in the way i told above.
    Thanks,
    Vinod.
    Edited by: Vinod Reddy Vemuru on Feb 28, 2009 4:36 PM

  • I have two Iphones with different email addresses sharing one Apple ID. Will that cause problems with using messaging and FaceTime?

    I have two Iphones 5 with different email addresses sharing one Apple ID account.Both are using IOS 8.
    I would like to set up a new Apple Id for one of the phones and remove it from the old account.
    If I do that, can I move all of the purchased apps and songs to the new Apple account?
    Also, will sharing one Apple ID account with two devices cause problems with using messaging and FaceTime?

    Sharing an iCloud account between two devices can be done without causing issues with iMessage and FaceTime, just go into Settings for each of these functions and designate separate points of contact (i.e. phone number only, or phone number and unique email address).  While that works, you'll then face the problem where a phone call to one iPhone will ring both if on the same Wi-Fi network -- but again, that can be avoided by changing each phone's settings.
    Rather than do all that, don't fight it -- use separate IDs for iCloud.  You can still use a common ID for iTunes purchases (the ID for purchases and iCloud do not have to be the same) or you can use Family Sharing to share purchases from a primary Apple account.

  • TS2755 Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help of how to set up messages on each

    Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help on how to set up messages on each device separately and to start using messages app on each device independently. Thanks

    search google for "iphone remove picture from contact"

  • I can use my appleID without any problems for using to download new apps in the app-store or Itunes - Problem: I can´t use my ID at facetime and Imessage - I´d like to add an EMail account on top to my mobile number. My password will not be accepted!!!???

    I can use my appleID without any problems for using to download new apps in the app-store or Itunes - Problem: I can´t use my ID at facetime and Imessage -
    I´d like to add an EMail account on top to my mobile number to use more this services. My password will not be accepted!!!??? I try it and i try it and i try ist, throughout the same problem. Whats on? The user help desk said, i´ve to reset and use the WLAN key new as well as possible - no way!

    Contact the App store for Apple ID help. Their support link is on the right of the App store window
    LN

  • Guys i have a problem, I used to download apps from one of my friends apple id, now i created my new account, but when i was about to update my apps its asks for my friends id and password. now how could i update my old apps from my new apple id?

    Guys i have a problem, I used to download apps from one of my friends apple id, now i created my new account, but when i was about to update my apps its asks for my friends id and password. now how could i update my old apps from my new apple id?

    The_Tonmoy wrote:
    I have no communication with my that friend :/ So it means i need to delete those apps? There's no other solution to update those apps?
    No.  purchases are forever tied to the apple ID used to buy them.  Delete them and buy your own copies.

  • Problems in using database link

    Hi all,
    I have problems in using the following created database link:
    Name: fzanalyze
    User: fzanalyze
    PWD: xxx
    Host: fz.domain.com
    I get the following error message, if I try to start this select:
    select * from tab@fzanalyze;
    FEHLER in Zeile 1:
    ORA-12154: TNS:Couldn't resolve service name
    The problem, the TNS is correct, because I copied the hoststring from the tnsnames.ora. Also I can connect to the database by using the given hostname as follows:
    connect fzanalyze/[email protected]
    connected
    What could be the problem, the I get the tns-Error, although I can connect normal to the database??
    Thanks for helping
    Dana

    Dana,
    Unlike Kamal, I don't use SQLNET anymore (isn't it obsolete from 8i+?), so I don't have any sqlnet.ora on my client or server.
    I'm not really a sysop, so no clever thoughts behind the following ideas, I just use these for development purposes at home:
    IP range at home = 192.168.x.x segment (another router server connects to the internet)
    Oracle server computer name = dbserver.seinpost.nl (local address = 192.168.1.110)
    instance entry in $TNS_ADMIN/listener.ora @ server:
        (SID_DESC =
          (GLOBAL_DBNAME = inst04.seinpost.nl)
          (ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
          (SID_NAME = inst04)
        )instance entry in $TNS_ADMIN/tnsnames.ora @ server:
    INST04.SEINPOST.NL =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver.seinpost.nl)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = inst04.seinpost.nl)
      )instance entry in tnsnames.ora @ client:
    INST04 =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS =
            (PROTOCOL = TCP)
              (HOST = 192.168.1.110)
                (PORT = 1521)
        (CONNECT_DATA =
          (SERVICE_NAME = inst04.seinpost.nl)
      )So again, no sqlnet.ora and as you can see only on my client I use local IP addresses to prevent my client for searching the internet for the non-existing dbserver.seinpost.nl address
    Hope this helps,
    Michiel

Maybe you are looking for

  • Albums not showing photos

    I am just learning about IPhoto 5. I made albums and all was great for days with slide shows and all. Then I added some new photo's to albums, now my albums will not show photo's. I can only see my photo's in IPhoto folders that are of various number

  • Error writing metadata to photo files

    I am using CS6 and have moved to a new computer with a clean install of CS6 under Windows 8.1.  In the past I had no problem using Bridge to append my personal metadata file to photos (RAW files, NEF).  With the new installation I am getting the repe

  • Project Size

    Hi, I am looking to do projects for a triple screen setup, 2400x600. I am currently using PE 3 and can export to that size, but can't add any text that is outside the monitor screen. Can I create movies in any size in Pro CS3 Max

  • New (Used) Ipod Mini Owner

    My friend is a Ipod Guru and recently gave me a old Ipod Mini Model M9160LL (I dunno if that is a 1st or 2nd gen). I am killing myself trying to figure out how to get my PC to recognize it. I have all 2.0 USB Port on my pc (But I have tried them all)

  • Mounting Disks in Tiger

    I am trying to move my Virtual Memory files to an underutilized internal disc in my G4 Mac. I believe I have the setup correct because the files are getting created in the desired directory location, but not on the desired disc. I'm pretty sure what