JComboBox question (size of entry)

I have a JComboBox that I am populating with a wide varying length of entries and in order not to mess up my GUI I need to constrain it to a certain size. This works but the drop down menu that is shown when the user clicks on the combo box stays the same width... I was hoping (and still holding out) that there is a way for it to be only the part on the GUI be constrained and have it expand so you can read the entire entry when the user opens up the combobox... This is how it is in web environments so does anyoen know a way I can accomplish this?

I had these results from searching forum on the combobox horizontal scrollbar keywords:
http://onesearch.sun.com/search/developers/index.jsp?col=devforums&qp_name=Swing&qp=forum%3A57&qt=combobox+horizontal+scrollbar
Hope that helped,
Regards.

Similar Messages

  • JcomboBox list size is wrong if using PopupMenuListener

    Just wondering if someone else has already implmented the workaround for this bug and would be able to tell me if it was very difficult to get going.
    Basically, if you use PopupMenuListeners to populate a combo-box list dynamically when the user selects the combo, the size of the list which gets presented to the user is based on the number of entries the combo previously had, not teh size of the new list.
    http://developer.java.sun.com/developer/bugParade/bugs/4743225.html
    We were hoping that this would get fixed in v1.5, but customers are complaining so much, its getting to the point where we will have to code a work-around. Just wondering how nasty it is to do.

    Basically, if you use PopupMenuListeners to populate a combo-box list dynamically ...I guess I don't fully understand what you are attempting to do, so I guess the next question is why are you using a PopupMenuListener to dynamically change the contents of the comboBox? Why does clicking on the dropdown menu cause the contents do dynamically change? Usually the contents are change as a result of some other action by the user. Maybe some sample code will clarify what you are attempting do do and an alternative approach can be suggested.
    For example, this thread shows how to dynamically change the contents of a second combBox when a selection is made in the primary comboBox:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=428181

  • CLEAN_REQREQ_UP  SRM5.5 - Question re field entry

    Hi
    Within SRM5.5 for clean_reqreq_up, in the classic scenario,  does the logical system field require an entry ie the backend system or should it be left blank ?
    The reason for the question is that if a held LOCAL PO is deleted,  the end users check status does not show this when the clean program is run with the backend logical system input, but if left blank, the status does show in the check status graphical view.
    We have always run clean program with the backend system in on versions 2.0c, 3.5 and 5.5 and we had no issues, but after a few support packs, this is now a minor problem.
    OSS message was raised, but it seems that we may not now need a logical system in the field.
    Can anyone advise on how the job is recommended to be set for the logical system.
    Thanks

    yes. i schedule this job for every 3 minutes .
    if you have more than one backend system it is definetly required.
    even you can create a variant and mention logical system if you want.
    Muthu

  • Case Questions - Size and Drive Mounting

    Planning ahead for a new i7 system, I'm going to buy components as I find them on sale... so have 2 questions about a new case
    First is Drive Mounting
    Everything I see today (have not looked at every possible case) uses some kind of "thumb lock" to mound 5.25 drives, such as a DVD drive or, in my case, the hard drive swap hardware I am going to use (Vantec MRK-200ST-BKSATA which goes in a 5.25 opening, then hard drive goes in a housing to slide in and out easily)
    I am used to the old style case with screw holes to mount 5.25 drives... so... do the new style cases really work well to hold a drive securely?
    Next question is about case size
    I'm looking at a mid-tower case http://www.newegg.com/Product/Product.aspx?Item=N82E16811119196 that seems as though it is plenty big enough for my needs, with enough 5.25 openings for DVD and two hard drives... and 3 case fans for cooling... and what looks like plenty of case width to be able to put a Noctua cooling tower on the i7 CPU
    I'm also looking a  full-tower http://www.newegg.com/Product/Product.aspx?Item=N82E16811119160 that doesn't seem to me to "really" offer anything more I need, since I'm not going to have a raid array and will only have 1 video card
    But... is there some advantage I'm not seeing to having a full-vs-mid-tower case?

    I did what I should have done in the 1st place, and read the size specifications
    A full tower case won't fit in my cabinet (heavy wood furniture we... ie the designer wife... bought for both sides of the office)
    I don't need as many external drive bays as the F-T has, so the mid-tower will do fine on that specification
    The Coolermaster Scout comes with 3 fans... front, top and back... and has side mounting for up to 2 more for CPU and video card... so I don't think cooling will be a problem
    Now, my only point of "wonder" is never having used the type of drive mounting it has... some sort of "thumb thing" you push to lock?
    But, since ALL the cases I've looked at seem to have the same/similar mounting, I guess they work OK
    Since the CM Scout, and the Corsair 850w power supply are both on sale right now, I think I'm going to buy when I get done with the Honey-Do list and put them away until I'm ready to build... which will be when Win7 64bit is a SP-1 level
    Thanks for the comments
    ADDED
    Found some pictures of the CM Scout, one of which was of the "stuff" that comes with the case
    There are drive "rails" included that look like they go on the sides of the 5.25 drives, and then those are locked into place by the quick release case locks
    ADDED2
    I have been planning on using drive swap hardware (like my current computer) to easily change boot or data drives... but now I'm thinking I'll just keep an extra drive on hand, with an Image of the boot drive made to external drive, and only actually change a drive in case of failure
    I now use a dual boot with 1st boot Win2k and Premiere 6 to run my Pinnacle Dv500 and 2nd boot WinXp, so will just set up one drive with Win2k and Win7 64bit
    I'll most likely get a 320Gig Sata drive for boot (and extra in reserve) and a 1-T Sata drive for data... with 1-T of space, I can simply put different projects in different folders and, for SD work, I'll have ample space (and, by the time I actually build, I may be able to afford a 2-T data drive)
    ADDED3
    While they are on sale, and to spread the hit to my tiny budget, I ordered PS and Case today
    PS - http://www.newegg.com/Product/Product.aspx?Item=N82E16817139009
    Case - http://www.newegg.com/Product/Product.aspx?Item=N82E16811119196
    Next month (or sometime soon) I'll watch for Sata drives on sale at Newegg
    I'm going to wait until just before I build to buy a motherboard, since by then the Gigabyte I'm looking at MAY be on a 2nd revision with refinements

  • Question on the entries in the oc4j log

    Hi all,
    If anybody could help me on the following issue, It is highly admirable. Thanks in advance.
    There is a module in our application to send mails to the people working in the organization regarding their work.
    We have a java servlet that send mail to the people. This servlet is called from a pl/sql programming. During this process, few of the people are not getting the emails. But the exact information is un known. But it writes to the oc4j log. we could only see entries like below for that particular day,
    11/06/04 19:06:44 Session
    11/06/04 19:07:02 Session
    11/06/04 19:07:24 Session
    11/06/04 19:07:27 Session
    [060411_111057028][][ERROR] Could not create an image. Set html-image-dir and html-image-base-uri correctly.
    [060411_111058371][][ERROR] Could not create an image. Set html-image-dir and html-image-base-uri correctly.
    [060411_111105559][][ERROR] Could not create an image. Set html-image-dir and html-image-base-uri correctly.
    [060411_111108074][][ERROR] Could not create an image. Set html-image-dir and html-image-base-uri correctly.
    [060411_111109590][][ERROR] Could not create an image. Set html-image-dir and html-image-base-uri correctly.
    [060411_111133949][][ERROR] Could not create an image. Set html-image-dir and html-image-base-uri correctly.
    [060411_111134933][][ERROR] Could not create an image. Set html-image-dir and html-image-base-uri correctly.
    Other than these entries there is nothing else written to the log. I am neither an expert in the application server nor a java programmer. If anybody can guess at the problem, please do it.
    Thanks,
    Suresh.

    "Could not create an image. Set html-image-dir and html-image-base-uri correctly."
    Probably a custom message generated by the servlet. Do you have some kind of installation
    manual that goes along with the set-up. I am not a clairvoyant but it looks like the application
    is expecting you to set a certain directory in which images are contained. Or it could be you
    have set the directory, but forgot to add the right image.

  • BPM question - Delete all entries in a table and Insert data

    Hello,
    I'm new to PI BPM and have this scenario to implement.
    I'm supposed to delete all entries in a table and then insert data to the same table.
    Is BPM necessary? If it is, what is the best practice to implement my scenario?
    I want to make sure that all entries were successfully deleted before insert data.
    How do I check if all entries in the table were deleted successfully before
    initiating insert.
    Thank you.
    -Won

    Hi Won,
    Yes, this is possible without BPM.
    You have to create 2 separate mappings, each for deleting & inserting the records.
    You will have 2 different Interface mappings as well.
    But in ID, create a single interface determination.
    In that, configure Deletion interface mapping first and in the second row, configure Insertion interface mapping.
    Please make sure that the parameter 'Mainain Order At runtime' is checked in interface determination.
    -Supriya.

  • Question regarding all entries

    code 1 Loop at int_cntry.
                 Select single * from zfligh into int_fligh
    where cntry = int_cntry-cntry.
    Append int_fligh.
                Endloop.
    code2 Select * from zfligh appending table int_fligh
                For all entries in int_cntry
                Where cntry = int_cntry-cntry.
    Hello Expert
    i am new to sap abap i need your help regarding all entries .
    it is not a good idea to write select query inside a loop. code 2 will show better performance than the code one because it fetches data from database in a one go but i want to know more details about all entries .if you know more please help
                                                                                    Thanks in advance
                                                                                    Chitta Ranjan Mahato
    Edited by: Mahatoji on May 24, 2010 12:32 PM

    HI,
    its better to go for For all entries based on the performance. It will fetch the records based on the entries available in the first table. But before going for For all entries, check the first internal table with not initial, if there is no records in the first internal table then it will fetch all the records into the second internal table.
    <removed by moderator>
    Thanks
    Arul
    Edited by: Thomas Zloch on May 24, 2010 6:01 PM

  • JComboBox question

    i am using a JComboBox in a JPanel all goes well and it is doing exactly want iwant it to do,
    there is one little thing that is bad though, when the JComboBox closes itselft after a selection has been made, the surface that was beneath the expended JComboBox is just not showing anymore.... instead of the components, the background color is all that is showing...
    any one knows how to prevent this or how to make it refresh what it did?
    i have tried to put inside the itemStateChanged() the following:
    myJFrame.validate();
    or
    myFrame.doLayout();
    myFrame.validate();
    or
    myFrame.repaint();
    but nothing seems to work
    any help would be appreciated, thx
    PoPo

    yes , and the action happens properly
    heres the code :
    public void itemStateChanged( ItemEvent event )
    if(event.getSource() == JComboBoxEssNomComm)
    if(test == 0)
    JLabelEssCouranteReponse.setText((JComboBoxEssNomComm.getSelectedItem()).toString());
    test++;
    else
    JLabelEssCouranteReponse.setText((JComboBoxEssNomComm.getSelectedItem()).toString());
    // insert refresh code here
    those actions do happen properly ... but no refresh will work....

  • 7.0 question on IMG entry Define Acct Ident for Multi BP

    IMG  t-code CRMC_IC_BPPROFMUL in the Profile Default select Search Tabs "Account Roles" choosing Account BP Business Partner (sequence 10) then choosing account roles are config entries
    CRM000     Sold-To Party   seq 10
    CRM006     Consumer        seq 20
    In my Business Role I have assigned profile Default in BPIDENT_MULTIPLE.
    But in the ic agent account search we were only getting CRM000 in the results, shouldn't this config entry find both CRM000 & CRM006 accounts?
    If we set CRM006 to the lower seq then we found the CRM006 but not the CRM000 acounts.
    Our developer was able to enhance the class to get both the CRM000 and CRM006 BP's but trying to verify if we should have found both the CRM000 & CRM0006 without the enhancement?
    Thanks,

    Hi Glenn,
    I tried that scenario on mine using "DEFAULT" for multiple bp which is set up the same way as you describe, and if I select Account Role "All" from the Account search, I get results of partners with role Sold-To Party and role Consumer. Are you searching based on account name?
    Sincerely,
    Glenn
    Glenn Abel
    Covington Creative
    www.covingtoncreative.com

  • Question about an entry level java programmer

    i was curious that if i do find a job in java as an entry level what kind of programming can i expect? i am sure some of the members over here were hired as an entry level. can you share your ideas with me? like any projects etc...

    What is your background in education? I don't know how much you know of Java, but that won't be the only thing they base their choice on. You barely ever have a project that uses exclusively java. Make sure you know basics of working with databases, different operating systems...
    The most important thing is that you can sell whatever you know as usefull for the job they have for you! Prepare yourself well for an interview. If you have the time, picture the type of work you expect from a vacancy. Ask yourself what technologies will be needed for that particular job and make sure you do at least know a little about them. Make sure you adapt your responses to the type of interviewer, type of company. In addition to that, don't tell people you know more than you do!
    Get some understanding on OO concepts.This would be a very important thing for some, but totally unnecessary to others. For me this is quite important! If your interviewer is a manager type, he won't be able to follow what you're talking about if you start talking about design principles! If your interviewer is a techie, then this is a good thing to show.
    JCP certification would be handy..From my experience this isn't a minimum requirement to get in. If the company values certificates, you can always use it afterwards to prove your dedication and get a raise once you're in. ;-)
    Further knowledge in Web components and Enterprice components (eg EJB) will be pluses.Again viewed from the 'make it sellable' side. If you come bragging that you're a Spring expert and your company is against open source frameworks, that won't be a point in your advantage.

  • Document currency and exchange rate processing question during order entry

    Hi Gurus,
      I have an issue where all our price records are stored in currency USD. When we take an order for a country that requires pricing to be in an alternate currency, the document currency is changed during order entry. This results in any price condition records retrieved through the condition techique to get converted correctly per the exchange rate. However we have conditions that are calculations off of the conditions retrieved using condition formulas. For example we have a condition which represents 90% of our list price. List price is retrieved in USD  as 10.00 USD and converted to alternate currency 63.40 TTD with an exchange rate of 6.34, but our calculation dollar value remains in USD but displays the alternate currency as 9 TTD, should be 57.06 TTD . We are using standard pricing formulas. I know I can call a conversion function within my formula to get it right, however, is this correct system behavior? I expected standard SAP to convert all price results leveraging exchange rate into document currency. Any guidance will be appreciated.
    Matt

    Hi,
    I went through the problem and still feel that there is somethign wrong in the routine which is used. You can confirm this by removing the routine from the condition type in the PP, and manually entering the value for the c.type in SO in USD and then check if the value is coming correctly in document currency. If the translation is happening for one condition type correctly and not correctly for another condition type, it should be the issue only with the routine.
    Pls check the scenario without the routine and check once and accordingly update the situation.

  • JComboBox QUESTION - Listener Methods.

    Dear Everyone,
    At the moment I am working on a UI that utilises four JComboboxes. Each of the four JComboboxes contains an index of 10 numeric values, namely 0 - 9. I intend on using the concatenated values of all four boxes to represent a four digit year value, e.g.: 1583, 1902, 2050, 9504, etc.
    I need to write some code that listens to each of the four JComboboxes and places the user selected number (from the JComboboxes index) into a variable.
    Once the values of all four JComboboxes are held in four variables I then need to concatenate the variables so that they represent a single year, e.g.: 1583.
    Once I have the concatenated value I will then perform relative mathematical operations.
    If anybody has any suggestions as to how I can listen to the JComboboxes and then place the selected index values into variables they will be greatly appreciated.
    Thanks

    How about this:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    public class Jconbo extends JFrame
         Vector v       = new Vector();
         JComboBox jc1  = new     JComboBox(v);
         JComboBox jc2  = new     JComboBox(v);
         JComboBox jc3  = new     JComboBox(v);
         JComboBox jc4  = new     JComboBox(v);
         int       year = 0;
    public Jconbo()
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);}});
         for (int j=0; j < 10; j++) v.add(""+j);     
           setBounds(1,1,500,300);
         addJc(jc1);
         addJc(jc2);
         addJc(jc3);
         addJc(jc4);
         getContentPane().setLayout(new FlowLayout());
         setVisible(true);
    private void addJc(final JComboBox jc)
         getContentPane().add(jc);
         jc.setPreferredSize(new Dimension(100,24));
         jc.setSelectedIndex(0);
         jc.addItemListener( new ItemListener()
         {     public void itemStateChanged(ItemEvent e)
                   year = jc1.getSelectedIndex() * 1000 +
                           jc2.getSelectedIndex() * 100 +
                           jc3.getSelectedIndex() * 10 +
                           jc4.getSelectedIndex();           
                   System.out.println(""+year);
    public static void main (String[] args) 
         new Jconbo();
    Noah
    unformatted
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    public class Jconbo extends JFrame
         Vector v = new Vector();
         JComboBox jc1 = new     JComboBox(v);
         JComboBox jc2 = new     JComboBox(v);
         JComboBox jc3 = new     JComboBox(v);
         JComboBox jc4 = new     JComboBox(v);
         int year = 0;
    public Jconbo()
         addWindowListener(new WindowAdapter()
    {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);}});
         for (int j=0; j < 10; j++) v.add(""+j);     
         setBounds(1,1,500,300);
         addJc(jc1);
         addJc(jc2);
         addJc(jc3);
         addJc(jc4);
         getContentPane().setLayout(new FlowLayout());
         setVisible(true);
    private void addJc(final JComboBox jc)
         getContentPane().add(jc);
         jc.setPreferredSize(new Dimension(100,24));
         jc.setSelectedIndex(0);
         jc.addItemListener( new ItemListener()
         {     public void itemStateChanged(ItemEvent e)
                   year = jc1.getSelectedIndex() * 1000 +
                        jc2.getSelectedIndex() * 100 +
                        jc3.getSelectedIndex() * 10 +
                        jc4.getSelectedIndex();           
                   System.out.println(""+year);
    public static void main (String[] args)
         new Jconbo();
    }

  • Question about an entry in /etc/sudoers

    I have the following entry in my /etc/sudoers:
    user ALL=(ALL) ALL
    Now I am not sure what that actually does. Could you explain it to me?

    I'm guessing "user" is your username.  That allows you to use sudo with any command.  It is possible to set finer restrictions for some users.

  • Another JComboBox question

    How do I get the text that has been typed in an editable JComboBox? When I looked inside the source for the class, I didnt even see a JTextField anywhere.
    Thanks

    The same way you'd get it if it wasn't typed in....

  • Question about Multiple Entries

    We are thinking about signing up for FormsCentral to do a contest (among potentially other things). One important feature to us is that people are only allowed to submit the form one time. Does FormsCentral have the ability to do this? Thanks!

    No, limiting submissions from one user is not something FormsCentral supports.
    You can embed the from into your own web page that you could control access to where you set up a system only allowing users to log into that page one time, when the user submits the form it could redirect out of that page and then the user would not be able to log into it to fill out the form again.  But this would all (except the redirect) be controlled by you and your website.
    Thanks,
    Josh

Maybe you are looking for