Preventing JComboBox from automatically resizing

Discussion in 'Mac Programming' started by foidulus, Oct 8, 2008.

  1. foidulus macrumors 6502a

    Joined:
    Jan 15, 2007
    #1
    In the latest Java update, the combo boxes we use for our app are broken, they display the last 3 characters as "..."(which is weird since well, ... is 3 cahracters :cool: )

    Anyway, is there a way to set the size and not have it change when the selected item changes? If I could fix that then I can fix the rest of the problems.
     
  2. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #2
    Did you look at the methods of the Component class, from which JComboBox is a subclass? There are several methods to get and set size.
     
  3. foidulus thread starter macrumors 6502a

    Joined:
    Jan 15, 2007
    #3
    Tried all those. While they set the size correctly when they are first called, after the selection is changed once the OS seems to take over and resize it how it sees fit, no matter what I ask.

    I even added an item selection listener to try to change the size when a selection occurs, but the OS so helpfully ignores my request.....
     
  4. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #4
    What layout manager are you using? What JVM release?
     
  5. foidulus thread starter macrumors 6502a

    Joined:
    Jan 15, 2007
    #5
    Null layout manager and the latest and greatest from Apple, however neither of those are really the problem, the problem was me being a bit of a doof and not realizing that the box was being resized somewhere else.

    Thats what you get for having legacy code interface with a GUI via CORBA...

    Seems to work now. The lesson is null layout manager == teh hard to port
     

Share This Page