Disable horizontal scrolling for iPad

Hello

I know that various iterations of this issue are floating around, but I was wondering if there is way to disable scrolling of elasic that iPad not without disabling the pinch zoom.

I want to use the shot to the left and right swipe to change the information on the screen. The iPad of course automatically scrolls the page and then bounces. The work of scanning, but any interface is too wobbly.

e.preventDefault();gives me the result of the move I'm looking but disables the zoom pinch. It is possible to have something between the two? When I go to yahoo.com on the ipad, it does not drag the screen to the left or right, only from top to bottom. Any ideas would be appreciated.

Thank you

Try to throw this in your

(replace by whatever your width)

Throwing just a guess, since I don't have an iPad to test with

Tags: Edge Animate

Similar Questions

  • Horizontal scrolling for the GridField Manager problem

    Hi all

    I have my working in the Application in which I have my display my data using GridField Manager. I used the code in the example given in link by tboatright of the user.

    Now in my application, I used the extension of the screen and it automatically gives the vertical scroll bar if the total height of lines in my GridField Manager is more than BB Simulator screen. In using this I can scroll vertically easily by substituting navigationMovement (int dx, int dy, int, int time status) method...

    Now the problem is, I have 6 columns in my network manager and their width is 80 each. So only 3 columns are displayed on the Simulator screen when the first time grid is displayed but I get no horizontal scroll bar, I m not able to scroll horizontally through my all columns. Now using dominant navigationMovement (dx int, int dy, int, int time status) method (in accordance with its encoding in the above link), I am able to setFocus on the columns by pressing the left/right keys on my keyboard on Simulator of BB, but with this screen doesn't move (scroll) left or right accordingly if I m not able to see column4 column 5, column6, which are placed to the right of the main screen width of BB.

    I hope that my question in the clear for you guys...

    Thanks in advance

    You have set the style for the screen like HORIZONTAL_SCROLLBAR and HORIZONTAL_SCROLL? because the style VERTICAL_SCROLL and VERTICAL_SCROLLBAR will be set by default. We must define explicitly for horizontal scrolling

  • Horizontal scrolling for textfiled

    I created the textfield that used the image to focus, unfocus. I could ' t able to move the horizontal scrolling of the slider on the textfield. If I removed the focus for below constructor method it's excellent work for both horizontal scroll and cursor position. Please, help me to horizontal scrolling is defined (if the character hit is greater than textfield width).

    class Textbox extends Manager {
        private int managerWidth;
        private int managerHeight;
        private int arcWidth;
        private VerticalFieldManager vfm = new VerticalFieldManager(
                NO_VERTICAL_SCROLL | USE_ALL_WIDTH |HORIZONTAL_SCROLL);
        private AutoTextEditField  editField;
        private Bitmap bagBitmap;
        int fntSize=26;
        String strhint,hint,str_img;
        Textbox(String _hint, final String image,final String focusImage, long style) {
            super(style | NO_VERTICAL_SCROLL | NO_HORIZONTAL_SCROLL);
            managerWidth = 300;
            managerHeight = 40;
            hint = _hint;
            str_img = image;
            long innerStyle = style & (READONLY | FOCUSABLE_MASK); // at least
            if (innerStyle == 0) {
                innerStyle = FOCUSABLE;
            }
            bagBitmap =Bitmap.getBitmapResource(str_img); // initialize the image to draw
            editField = new AutoTextEditField("", "", 50, innerStyle|AutoTextEditField.NO_NEWLINE){
                    public void paint(Graphics g) {
                        getManager().invalidate();
                        FontFamily fontFamily[] = FontFamily.getFontFamilies();
                        this.setFont(fontFamily[1].getFont(FontFamily.SCALABLE_FONT,fntSize).derive(Font.SIZE_MEDIUM, fntSize,Ui.UNITS_px));
                        super.paint(g);
                    }
                    protected void onFocus(int direction){
                        str_img = focusImage;
                        bagBitmap = Bitmap.getBitmapResource(str_img);
                        invalidate();
                    }
                    protected void onUnfocus(){
                        bagBitmap = Bitmap.getBitmapResource(str_img);
                        invalidate();
                    }
            };
            arcWidth = 15;
            vfm.add(editField);
            add(vfm);
        }
        public void setFont(net.rim.device.api.ui.Font font) {
            FontFamily fontFamily[] = FontFamily.getFontFamilies();
            this.setFont(fontFamily[1].getFont(FontFamily.SCALABLE_FONT,fntSize).derive(Font.SIZE_MEDIUM, fntSize,Ui.UNITS_px));
            editField.setFont(fontFamily[1].getFont(FontFamily.SCALABLE_FONT,fntSize).derive(Font.SIZE_MEDIUM, fntSize,Ui.UNITS_px));
            arcWidth = editField.getFont().getHeight() & 0xFFFFFFFE;
            updateLayout();
        }
        public int getPreferredWidth() {
            return managerWidth;
        }
        public int getPreferredHeight() {
            return managerHeight;
        }
        protected void sublayout(int w, int h) {
            if (managerWidth == 0) {
                managerWidth = w;
            }
            if (managerHeight == 0) {
                managerHeight = h;
            }
            int actWidth = Math.min(managerWidth, w);
            int actHeight = Math.min(managerHeight, h);
            layoutChild(vfm, actWidth - arcWidth, actHeight - arcWidth);
            setPositionChild(vfm, arcWidth / 2, arcWidth / 2);
            setExtent(actWidth, actHeight);
        }
        protected void paint(Graphics g) {
            g.drawBitmap(0, 0, getWidth(), getHeight(), bagBitmap, 0, 0);
            strhint = editField.getText();
            if ( strhint == null || strhint.length() < 1 ) {
                g.setColor( 0xAFAFAD );
                FontFamily fontFamily[] = FontFamily.getFontFamilies();
                net.rim.device.api.ui.Font font =   fontFamily[1.getFont(FontFamily.SCALABLE_FONT,fntSize).derive(Font.SIZE_MEDIUM, fntSize,Ui.UNITS_px);
                g.setFont(font);
                g.drawText(hint, 10, 10, 30, 250);
            }
            super.paint(g);
        }
    }
    

    Could you explain that again so I do not understand your problem.   It doesn't seem to be a code of development/unfocus in there?

    But before we do, there are a few problems with your code, you need to fix.

    In no particular order:

    (a) I painted the 'index' in the EditField, rather than in this area.  In this way it will appear when a user types rather than being anywhere where '10, 10' is on your property.

    (b) move this code:

    FontFamily fontFamily [] = FontFamily.getFontFamilies ();
    this.setFont (fontFamily [1] .getFont (FontFamily.SCALABLE_FONT, fntSize) .derive (Font.SIZE_MEDIUM, fntSize, Ui.UNITS_px));

    your routine painting and put it in sublayout.  This is the point that it is necessary.  Do in object means it is too often and is probably recursively called.

    As a result, you should be able to remove

    getManager () .invalidate ();

    any object and

    updateLayout();

    of setFont().

    (c) when you paint your index, derive the police every time that:

    FontFamily fontFamily [] = FontFamily.getFontFamilies ();
    net.rim.device.api.ui.Font fonts fontFamily = [(FontFamily.SCALABLE_FONT, fntSize) 1.getFont .derive (Font.SIZE_MEDIUM, fntSize, Ui.UNITS_px);]

    This is inefficient, you need only do this once and save a reference to it for use when you paint your index

    Do all these you will have a better field and maybe your problem will be solved.  But if not, then please explain your problem again with more details and repost your fixed code.

  • Problem Manager of horizontal scrolling for OS 6.0 and more?

    Hi all. I have a problem with the Manager of Horizontal scrolling. Every thing worked for OS 5.0 and below, the question arises for OS 6.0 and more. For example, check the following:

    I have 2 HFM added to the optimization of resources.

    HFM1 - contains 2 buttons.

    HFM2 - contains 6 buttons, and the user can scroll between the buttons.

    The questions is when user keep hitting the right key, when the focus is on the second button of HFM1, then the content of HFM2 scrolls to the right - what is bad behavior.

    Check the screenshot for Simulator 9810 (when scrolling to the right inside the HFM which contains the test1, test2 scrolls the second HFM):

    Scrolling in a managing scrools in another, why this happen and how that might be solved?

    Thank you in advance.

    Finally, I found a solution using ScrollChangeListener (SCL).

    So what I did I set the SCL for HFM2, then:

     public void scrollChanged(final Manager manager, int newHorizontalScroll,
                int newVerticalScroll)
        {
    
            //----> fixing the issue when one HFM scroll another one for OS 6.0 and above
            int fwf = manager.getFieldWithFocusIndex();
            if (fwf == -1)
                manager.setHorizontalScroll(0);
            //<---- fixing the issue when one HFM scroll another one for OS 6.0 and above
    
    }
    

    Thanks to all in any case.

  • disable horizontal scrolling

    After trying to install a couple of new widgets that I have since disabled, my pages are scrolling off center when you use the buttons that are related to the anchor points. Here is a page that exposes the problem:

    CONTACT

    If you press the 'connect' button below the contact form, you will see that it scrolls down and to the right. Here's the code I used before to prevent what seems to no longer work:

    HTML, body {overflow-x: hidden ;}}       This will hide the horizontal scroll bar, to hide the vertical scroll bar {overflow-y: hidden}; to hide all the scrollbar {overflow: hidden ;}}

    Anyone know how I can fix these buttons so that the images don't scroll horizontally?

    This could be due to the image of the card that you have on the page.

    I would try a test without the image of the map to see if it solves the problem.

    As a note of design, I don't think you really need this anchor.

    The information that you want your user to be fairly close to the form, I propose just that the graphics below upwards a little.

    A simple scrolling to the bottom of the page will get the user as easily.

  • Horizontal scrolling for Apex 4

    I need horizontal scroll from one page to the Apex 4. I saw an old thread on horizontal scrolling using Apex 3.2. Here is the link to that thread where vee has given some code of the plugin to achieve this scrolling:

    bar Scroolling fixed.

    I saved the code in the thread in the js file and tried to import it as a plugin, but the import has failed, saying that it was not a plugin file.

    All the world is made in 4 Apex? I will be grateful for the guidance to achieve this.

    Thank you

    Hello

    For horizontal scrolling copy your theme 15 standard report to the new name.
    Model change front of lines to

    And model after lines to

    #EXTERNAL_LINK##CSV_LINK# #PAGINATION#

    Horizontal/Vertical scrolling, you must create same kind custom model I in sample application for the report page 1

    Kind regards
    Jari

    Published by: jarola April 20, 2011 17:56

  • White space to the right of the mobile Muse Web site. You will need to disable horizontal scrolling?

    Here is my temporary site:

    Home

    After having tried the codes below, the problem appeared to be fixed (browser). However, problem still happens when viewing on the mobile device or preview with x-code iphone Simulator.

    I tried the following:

    • No selection of all to ensure that no stray objects / elements are outside the page.
    • Cache - everything on the page (so that only master remains). Problem still there. It's not there when only master published.
    • Using this code(on both object and property of the master page and main html page):

    < style >

    HTML {overflow-x: hidden ;}}

    < / style >

    • Using this code (on both object and property of the master page and main html page):

    < name meta = "viewport" content = "width = device-width, scalable user = no" / > "

    Any ideas?

    Looks OK on an iPhone 6. Such problems often occur if page items extend beyond the page area. Another thing to check is if this occurs if you disable the Gallery widget you use. Due to their nature, the code used in the widgets sometimes conflicts with own Muse code, particularly if you use sensitive design with older widgets.

    David

    Creative muse

  • Problem with setting "Horizontal scrolling with tilt wheel"

    All of a sudden, everytime I open a spreadsheet it acts as if I am pressing the arrow button to the right and the active cell moves to the right as quickly as possible.

    At the same time:
    1. my wireless Microsoft mouse leave with the scroll wheel.
    2. when I click a down arrow, the menu is displayed for a split second, then disappears.
    Any ideas what may have caused this?
    * original title - Excel-unstoppable to the right at the opening of automatic pagination

    1 only with Excel

    2 Microsoft 6000v2.0
    3. since Monday morning, when I opened a spreadsheet
    4. the system changes. I didn't touch anything.
    5. the keyboard is clear. It only happens in Excel.
    I managed to do stop by disabling "horizontal scrolling with tilt wheel" in the mouse properties. Absolutely, I know for a fact that nobody changed this setting, but it became somehow activated.
  • Windows 8 - horizontal scroll on the mouse does not

    Hello, everyone,

    I have a system running 64-bit Windows 8. My Gigabyte M6980 mouse has a wheel tilt with a capacity to reach not only up and down but also left and right. However, the inclination of the wheel does not record in my Win8 machine.

    I plugged the mouse on a Vista laptop where initially the system has not yet recognized the mouse at all (the cursor is not mobile). After going to the Manager of devices and update the driver for the "unknown device" which was M6980, it became a "HID-compatible mouse. I could then move the cursor AND use the horizontal scrolling. On a Windows 7 computer, the mouse was recognized immediately and I could use horizontal scrolling very well.

    I tried to copy mouclass.sys of my laptop Vista and mouhid.sys to C:/Windows/System32/drivers on my machine Windows 8, but then the mouse could not be recognized at all the original files should be restored. The same thing happened when I copied the same files from a Windows 7 machine.

    Gigabyte support response is that the mouse does not officially support Windows 8 and all the features are not guaranteed. There are no drivers available for the device and the only software that comes with it is motor Ghost of Gigabyte for remapping keys. But given that horizontal scrolling works in Windows 7 without any additional software, I suspect driver Windows 8 HID is involved, although I could well be wrong. I couldn't Google solutions. Any help would be appreciated.

    See you soon,.
    Jesse

    Hi ShiuabKhan,

    Thanks for a quick reply. Windows 8 is now picking up the thin horizontal scrolling messages. I tried to randomly check the software option Gigabyte 'disable horizontal scrolling' and apply changes and then uncheck the new, and, curiously, it started working. However, I install the latest version of the software from Gigabyte (which just happened to be released February 1) in compatibility mode to be on the safe side.

    Although the system is now picking up messages from horizontal scrolling of the mouse, my Battlefield 3 game won't recognize them, but is not a Windows problem, so I'll find an answer elsewhere.

    Thank you much for the help!

    See you soon,.
    Jesse

  • Smooth horizontal scrolling

    Hello

    I noticed that National Geographic has horizontal aritcles marching slowly from left to right (not up and down). How do do that? What is only a function of business account?

    Would appreciate a quick response.

    Thank you.

    They have either a large pan and zoom overlay on the page, or they simply two items that have the good-aligned content it looks like a smooth roll (but isn't).

    There is no feature of magic smooth horizontal scrolling for the clients of the company.

    Neil

  • Need to disable acceleration hardware and smooth scrolling for users on a Remote Desktop Session.

    Hello
    I need to disable acceleration hardware and smooth scrolling for any user that connects to an RDS Server. I messed up the mozilla.cfg and created an autoconfig.js file. I guess I'm missing something along the way.

    This is currently my autoconfig.js
    Pref ("general.config.filename", "mozilla.cfg");
    Pref ("general.config.obscure_value", 1);
    Pref ("app.update.channel", "liberation");

    Mozilla.cfg
    Smooth Scrolling disabled
    lockpref ("general.smoothScroll.disabled", true);
    disables hardware acceleration
    lockPref ("layers.acceleration.disabled", true);
    lockPref ("gfx.direct2d.disabled", true);

    All that I'm missing? When I restart the two options are always checked in the options.

    Thank you!!

    Hi b1gt3x, you use a clear cfg file, you'll want to put this in your instead of autoconfig.js:

    pref("general.config.obscure_value", 0);
    pref("general.config.filename", "mozilla.cfg");
    

    In addition, you will have to make lockPref with a capital P in any case - that it reacts very sensitive to spelling errors...
    http://kb.mozillazine.org/Locking_preferences.

  • How do disable you dynamic horizontal scrolling "feature"?

    How do disable you dynamic horizontal scrolling "feature"?
    its totally _ me off. Im trying to use a new program of photo manipulation, but can't zoom in and because it scrolls the work area, I need trouble! Ugh! I swear to God _... it's just ridiculous!
    Please someone tell me how to disable this "feature".

    musgoodw, the best advice I can do is just play with the settings of '' mouse. ''  Just type mouse into the start menu.
    By default, a Synaptics touchpad has a vertical scroll box to the right of the touchpad. Some versions of pilot also (default) enable the horizontal scroll down box.
    Both can be changed to enabled, amount of space used, where they are, speed of scrolling and much more in the config of Synaptics.  You would be pleasantly surprised how you can set one up.  ;)

    HTH,
    Chris [If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]

  • How to set horizontal scrolling to horizontal field Manager when fields are added using a loop for?

    The following code snippet contains a horizontal field Manager to which are added five buttons.

    1. I can't the value of horizontal scrolling to horizontal management Manager because of who I am not able to access the keys 4 and 5.

    2. usually, we put horizontal scrolling in the following way:

    container = new HorizontalFieldManager(USE_ALL_WIDTH|HORIZONTAL_SCROLL|HORIZONTAL_SCROLLBAR);
    

    3. so I also tried setting of horizontal scrolling in the following way

       container = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL|Manager.HORIZONTAL_SCROLLBAR)
                {
    
                    protected void sublayout(int maxWidth, int maxHeight) {
    
                        Field field = null;
                        int x = 0;
                        int y = 0;
                        int maxFieldHeight = 0;
                        int maxFieldWidth = 0;
                        for (int i = 0; i < getFieldCount(); i++)
                        {
                            field = getField(i);
                            layoutChild(field, maxWidth, maxHeight);
                            setPositionChild(field, x/*width-field.getWidth()*/,y);
    
                            x+=field.getWidth();
    
                            maxFieldWidth = maxFieldWidth + field.getWidth();
                            System.out.println("field width"+field.getWidth());
                            System.out.println(" max field width"+maxFieldWidth);
    
                            if(i==0)
                            {
                                maxFieldHeight = field.getHeight(); // height set of the first button since all components have the same height
                            }
                        }
                        System.out.println("final max field width"+maxFieldWidth);
    
                        setExtent(maxFieldWidth, maxFieldHeight);
    
                    }
                };
    

    but it's not working.

    4 I found this property: (position) horizontalFieldManager.setHorizontalScroll; that contains the parameterioo where the post is supposed to be the new horizontal scroll position. I tried passing the coordinate x of horizontal field Manager, but it does not work. I should pass as a parameter position?

    HorizontalFieldManager container = new HorizontalFieldManager()
    {
        protected void sublayout(int maxWidth, int maxHeight)
        {
            Field field = null;
            int x = 0;
            int y = 0;
            int maxFieldHeight = 0;
            for (int i = 0; i < getFieldCount(); i++)
            {
                field = getField(i);
                layoutChild(field, maxWidth, maxHeight);
                setPositionChild(field, x,y);
                x+=field.getWidth();
                if(i==0)
                {
                    maxFieldHeight = field.getHeight(); // height set of the first button since all components have the same height
                }
            }
    
            setExtent(Display.getWidth(), maxFieldHeight);
    
        }
    };
    
    ButtonField button1 = new ButtonField("Button1");
    ButtonField button2 = new ButtonField("Button2");
    ButtonField button3 = new ButtonField("Button3");
    ButtonField button4 = new ButtonField("Button4");
    ButtonField button5 = new ButtonField("Button5");
    
    container.add(button1);
    container.add(button2);
    container.add(button3);
    container.add(button4);
    container.add(button5);
    
    add(container);
    

    Need your valuable comments and suggestions. Please help me.

    I think that there is a bug in the sublayout (your HorizontalFieldManager 0 mode.  Given that the code did what I think WHAT HFM will do anyway, I recommend that you try to do this with a standard HFM, using this style:

    Manager.HORIZONTAL_SCROLL | Manager.HORIZONTAL_SCROLLBAR

    Let us know how you go.

    When I have more time I'll explain the bug, but if you want to investigate something, be aware that the maximum size that you can use in setExtent are the values that are passed to sublayout.  Compare the width as you try to define in setExtent whose width is increased.

  • Issue of bottom paint for horizontal scrolling

    Hello

    I have a HorizontalFieldManager with a gradient background which I've updated to enable horizontal scrolling. Scrolling works well, but the gradient background is not painted when scrolling to the right. Using trial and error "getHorizontalScroll()" to calculate and offset has not yet failed.

    The original code is lower for horizontal management.

    ...
        hm = new HorizontalFieldManager(hmStyle) {
          protected void paint (Graphics g) {
            g.clear();
            g.setBackgroundColor(bgColor);
            int[] xInds = new int[]{0, 0,getExtent().width, getExtent().width};
            int[] yInds = new int[]{0, getExtent().height, getExtent().height,0};
    
            final int[] cols = new int[]{bgColor, gradientColor, gradientColor, bgColor};
    
            g.drawShadedFilledPath(xInds, yInds, null, cols, null);
            super.paint(g);
          }
          protected void onFocus(int arg0) {
            super.onFocus(arg0);
            getScreen().invalidate();
          }
        };
    ...
    

    I know I'm probably not set up the xInds properly to compensate for offset from horizontal scrolling, but it's not obvious to me how to set up the offsets correctly. Can anyone offer a suggestion to troubleshoot? If not, is there a reference to certain documents which provides more detail than the docs of java on the functioning of the 'drawShadedFilledPath' and the logic of ScrollBar?

    Thanks in advance!

    int xstart = getHorizontalScroll();
    int xend = xstart + getVisibleWidth() - 1; // getWidth() is also good
    int[] xInds = new int[]{xstart, xstart, xend, xend};
    
  • Horizontal scroll bar for JComboBox through multiple aspect

    From [http://www.coderanch.com/t/432788/GUI/java/JComboBox-horizontall-scroll-bar] and [http://forums.sun.com/thread.jspa?threadID=5369365], I know that the technique to have a horizontal scroll bar for JComboBox.

    However, their proposed solution are limited to the Look n Feel specific.

    As you can see, the below excerpt key code is malfunctioning, if users are Linux machine with GTK + look n feel, or machine Windows with Nimbus look n feel.

    How can I have a portable way to JComboBox able to have a horizontal scroll bar?

    The complete source code is [http://jstock.cvs.sourceforge.net/viewvc/jstock/jstock/src/org/yccheok/jstock/gui/AutoCompleteJComboBox.java?revision=1.16 & view = markup]

    The key code snippet are as follows:

    package org.yccheok.jstock.gui;
    
    public class AutoCompleteJComboBox extends JComboBox {
    
       @Override
        public void setUI(ComboBoxUI ui)
        {
            if (ui != null)
            {
                // Let's try our own customized UI.
                Class c = ui.getClass();
                final String myClass = "org.yccheok.jstock.gui.AutoCompleteJComboBox$My" + c.getSimpleName();
    
                try {
                    ComboBoxUI myUI = (ComboBoxUI) Class.forName(myClass).newInstance();
                    super.setUI(myUI);
                    return;
                } catch (ClassNotFoundException ex) {
                    log.error(null, ex);
                } catch (InstantiationException ex) {
                    log.error(null, ex);
                } catch (IllegalAccessException ex) {
                    log.error(null, ex);
                }
            }
    
            // Either null, or we fail to use our own customized UI.
            // Fall back to default.
            super.setUI(ui);
        }
    
        // This is a non-portable method to make combo box horizontal scroll bar.
        // Whenever there is a new look-n-feel, we need to manually provide the ComboBoxUI.
        // Any idea on how to make this portable?
        //
        protected static class MyWindowsComboBoxUI extends com.sun.java.swing.plaf.windows.WindowsComboBoxUI
        {
            @Override
            protected ComboPopup createPopup()
            {
                return new MyComboPopup(comboBox);
            }
        }
    
        protected static class MyMotifComboBoxUI extends com.sun.java.swing.plaf.motif.MotifComboBoxUI
        {
            @Override
            protected ComboPopup createPopup()
            {
                return new MyComboPopup(comboBox);
            }
        }
    
        protected static class MyMetalComboBoxUI extends javax.swing.plaf.metal.MetalComboBoxUI
        {
            @Override
            protected ComboPopup createPopup()
            {
                return new MyComboPopup(comboBox);
            }
        }
    
        private static class MyComboPopup extends BasicComboPopup
        {
            public MyComboPopup(JComboBox combo)
            {
                super(combo);
            }
    
            @Override
            public JScrollPane createScroller()
            {
                return new JScrollPane(list,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                        JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
            }
        }
    }
    Published by: 803903 on October 20, 2010 18:03

    Darryl Burke wrote:
    Purists will tell you that such things should not be done in a renderer

    not too purist - but there are thingies you MUST NOT spread like that pollutes community knowledge ;-)

    There is an official way (read: code of the heart itself does swing combo) to access the pop-up window and then do what you must

        private void adjustScrollBar(JComboBox box) {
            if (box.getItemCount() == 0) return;
            Object comp = box.getUI().getAccessibleChild(box, 0);
            if (!(comp instanceof JPopupMenu)) {
                return;
            }
            JPopupMenu popup = (JPopupMenu) comp;
            JScrollPane scrollPane = (JScrollPane) popup.getComponent(0);
            scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL));
            scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        }
        
    

    Simply assign the scroll bar will work at any time after the creation of the drop-down list (BTW: assigning the horizontalScrollBar null got really... didn't even know it is valid). If you want to resize the drop-down list, you will need to do it in a popupMenuListener willBecomeVisible: at this time, all internal components are ready for touch-ups. Just for fun, set up the drop-down list to adapt to the requirements of the size of a JXTable used as a rendering component:

        private void adjustPopupWidth(JComboBox box) {
            if (box.getItemCount() == 0) return;
            Object comp = box.getUI().getAccessibleChild(box, 0);
            if (!(comp instanceof JPopupMenu)) {
                return;
            }
            JPopupMenu popup = (JPopupMenu) comp;
            JScrollPane scrollPane = (JScrollPane) popup.getComponent(0);
            Object value = box.getItemAt(0);
            Component rendererComp = box.getRenderer().getListCellRendererComponent(null, value, 0, false, false);
            if (rendererComp instanceof JXTable) {
                scrollPane.setColumnHeaderView(((JTable) rendererComp).getTableHeader());
            }
            Dimension prefSize = rendererComp.getPreferredSize();
            Dimension size = scrollPane.getPreferredSize();
            size.width = Math.max(size.width, prefSize.width);
            scrollPane.setPreferredSize(size);
            scrollPane.setMaximumSize(size);
            scrollPane.revalidate();
        }
        
    

    and Yes, this is the example for setXXSize. But then, it isn't but application code a code 'in-house framework.

    See you soon... and the real work
    Jeanette

Maybe you are looking for