Horizontal scrollbar for JComboBox - Not workable under Mac

By referring to this thread Re: Horizontal scrollbar for JComboBox across multiple look and feel I try to provide horizontal scroll bar for JComboBox to my clients.
private void adjustScrollBar() {
    //if (this.getItemCount() == 0) return;
    Object comp = this.getUI().getAccessibleChild(this, 0);
    if (!(comp instanceof JPopupMenu)) {
        return;
    JPopupMenu popup = (JPopupMenu) comp;
    // Works fine under Windows and Ubuntu Linux
    // However, in OSX 10.6.4
    // javax.swing.Box$Filler cannot be cast to javax.swing.JScrollPane
    JScrollPane scrollPane = (JScrollPane) popup.getComponent(0);
    scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL));
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}The above code will cause ClassException under OSX 10.6.4. (Works fine for Windows and Linux)
Any suggestion to resolve this problem. Sorry. I do not have a Mac machine. Hence, can't experiment out much with it.
Thanks

The following code works quite well for me.
    private void adjustScrollBar() {
        final int max_search = 8;
        // i < max_search is just a safe guard when getAccessibleChildrenCount
        // returns an arbitary large number. 8 is magic number
        JPopupMenu popup = null;
        for (int i = 0, count = this.getUI().getAccessibleChildrenCount(this); i < count && i < max_search; i++) {
            Object o = this.getUI().getAccessibleChild(this, i);
            if (o instanceof JPopupMenu) {
                popup = (JPopupMenu)o;
                break;
        if (popup == null) {
            return;
        JScrollPane scrollPane = null;
        for (int i = 0, count = popup.getComponentCount(); i < count && i < max_search; i++) {
            Component c = popup.getComponent(i);
            if (c instanceof JScrollPane) {
                scrollPane = (JScrollPane)c;
                break;
        if (scrollPane == null) {
            return;
        scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL));
        scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    }

Similar Messages

  • Horizontal scrollbar for JComboBox

    Hi,
    I want to use Horizontal scrollbar for JComboBox which i have used as an editor for table column cell and the matter in drop down list is larger but the width of column of a table is relatively small
    Any suggetions!
    Thanks and regards,
    Nilesh

    Hi,
    I want to use Horizontal scrollbar for JComboBox which i have used as an editor for table column cell and the matter in drop down list is larger but the width of column of a table is relatively small
    Any suggetions!
    Thanks and regards,
    Nilesh

  • Apex 5.0, Horizontal scrollbar for Interactive Report  and Pivot Format

    Hi,
    i would like to know how to have an horizontal scrollbar for an interactive report (5.0) after making a pivot from the user interface; i have a lot of columns and without the pivot the horizontal scrollbar appears . After it doesn't appear.
    I tried with the Region Header <div style="overflow:auto;"> and Region Footer </div>  but without success.
    Regards
    Gianpaolo

    Hi gianpagi,
    gianpagi wrote:
    i would like to know how to have an horizontal scrollbar for an interactive report (5.0) after making a pivot from the user interface; i have a lot of columns and without the pivot the horizontal scrollbar appears . After it doesn't appear.
    I tried with the Region Header <div style="overflow:auto;"> and Region Footer </div>  but without success.
         Please mention the theme and template you are using for the Interactive Report.
         Can you re-produce the issue on apex.oracle.com and share the workspace credentials, so that can have closer look at the issue?
    Regards,
    Kiran

  • Horizontal scrollbar for plot legend

    Hello,
    The plots in my plot legend for a graph can have quite long names so it would be great having a horizontal scrollbar.
    Quote from here
    >>To add a scroll bar to a plot legend, right-click the plot legend and select Visible Items»Horizontal Scrollbar or Visible Items»Vertical Scrollbar from the shortcut menu.
    I can see the entry horizontal scrollbar, but it is always grayed out, what's wrong?
    Thanks a lot for your help!
    Cheers,
    Rico

    I think you are misinterpreting the use of the scrollbar.  If you have a lot of plots on your graph, then you can use the scrollabr to not show all the plots at once and this allows you to scroll through the list.  It does not allow you to make the plot legend smaller to hide long names and scoll across.
    So, if you resize the plot to be horizontal, then you can display the horizontal scrollbar:
    If you resize it vertically, then you can display the vertical scrollbar:
    Message Edited by Matthew Kelton on 05-09-2008 12:09 PM
    Attachments:
    Plot legend horizontal.png ‏2 KB
    Plot legend vertical.png ‏2 KB

  • Need horizontal scrollbar for af:selectManyChoice

    Hi,
    I use JDeveloper Studio Edition Version 11.1.1.7.0
    There is a field for which we use af:selectManyChoice ADF component.
    The component is displaying the vertical scrollbar to show all the values automatically.
    And width wise the component is expanded to show values. But, its not expanded to show the value which has maximum value.
    Can we add a property to instruct the component to take the maximum width of the values in the list?
    Or can we add a horizontal scrollbar to the component?
    Attached the screenshot.
    Regards,
    Tamil

    Hi,
    you can try CSS overflow:scroll to get a scrollbar. However, the width might be easier to set using CSS and can also be computed by a managed bean property
    http://www.w3schools.com/cssref/pr_pos_overflow.asp
    Frank

  • Mac OS 9 AFP file sharing volume not visible under Mac OS 10.5

    An old blue-white PowerMac G3 running Mac OS 9.2.2 with file sharing on is not visible on the network for a MacBook Pro running Mac OS X 10.5.5. – However, a PowerBook G4 with Mac OS X 10.4.11 perfectly shows the G3.
    Connecting to the G3 works on the new MacBook Pro with OS X 10.5 if I use the server's IP-address (afp://xxx.xxx.xxx.xxx) but does not work if I use the server's name (afp://<servername>).
    All other shares on the network are visible for both the MacBook Pro running OS X 10.5 and the PowerBook G4 running OS X 10.4.
    Why does the MacBook Pro with Mac OS X 10.5.5 not show the G3?
    Why can't I connect to the G3 using its AFP name?

    I think this is because there is no AppleTalk on Leopard.
    Ah, I stand corrected........
    Go to SystemPreferences > Network
    Select your connection in the left column. Advanced > AppleTalk
    Enable AppleTalk for your connection.
    sp
    Message was edited by: brainslice

  • Command-L doesn't work for full-screen PDF under Mac

    In Adobe Reader, users can use Ctrl-L to view PDF in full screen under Windows (Cmd-L under Mac);  in AIR, Ctrl-L still works under Windows but Cmd-L doesn't work under Mac. Is this a bug or the short-cut is intentionally disabled?

    Hi If using command r did not get you to the recovery partition, you ether don't have it or the drive is corrupt and it wont open.And you also tried option and only got the startup volume. You could try option r. Are you able to boot into your desktop? Or use another mac. You should be able to use you apple id to look in purchases and re-download Lion. Then if you can using at lest a 10 Gig thumb drive copy the lion download as bootable to it and use that to repair your disk. If you get it downloaded do not open it. until you copy it.http://www.macworld.com/article/1161069/make_a_bootable_lion_installer.html

  • Horizontal Scrollbar for af:selectOneListBox

    Hi
    Is there a way to fix the width of af:selectOneListbox such that for list values that are longer than stipulated width, a horizontal scrollbar can also be introduced to browse these values?
    I cannot pre-determine the longest item as values within af:selectOneListbox is loaded dynamically.
    Thanks a lot in advance!

    Hi,
    you can try CSS overflow:scroll to get a scrollbar. However, the width might be easier to set using CSS and can also be computed by a managed bean property
    http://www.w3schools.com/cssref/pr_pos_overflow.asp
    Frank

  • Xtra for export of jpegs under MAC

    Hi
    Is there any Xtra, which exports image-castmembers as JPG
    image under MAC OS
    I use RavImageXtra under Windows and need the same
    functionality under Mac
    Any help will be appreciated
    game_dev

    Andrew Morton wrote:
    > game_dev wrote:
    >> Is there any Xtra, which exports image-castmembers
    as JPG image under
    >> MAC OS
    >
    >
    http://www.sharp-software.com/products/sharpexportinfo.htm
    Also, see
    http://www.deansdirectortutorials.com/MileHighTable/#Import/Export
    Andrew

  • Horizontal scrollbar for JTable

    Hi folks,
    I just created a JTable with 15 columns. As number of columns are more, I am not able to view all data. Probabaly I would need a Horizonatal scrollbar. I used setPreferredScrollableViewportSize(), but it doesn't help me. Can u pls any body help me to make it work out?
    Thanx in advance.
    Regards,
    Ayyappan.

    Hi chuanhaochiu,
    Thanx for immmediate reply. I have already put JTable in JScrollBar. I am comfortably getting the vertical scrollbars when more rows are added. I am not able to get only the horizontal bar.
    Ayyappan G.

  • Save for web not working on mac

    Hi Everyone,
    I am giving photoshop elements 8 a trial but can't get the save for web to work.  When I click File -> Save for web it does nothing?
    Does anyone have any suggestions why this would be the case?
    I downloaded the trial today for Mac and have installed it twice with no joy.
    Cheers
    Luke

    Terri_F wrote:
    To do this, press and hold in the cmd + opt key and go through the menu and click File<Save For Web. A dialog will come up saying something like "Are you sure you want to erase all of the preferences for Save For Web". Click "Yes" to the dialog that comes up.
    I just tried this. No dialog box appeared.
    I am loading the software onto my MacBook Pro now, which is running 10.6. Hopefully I can use it on that machine, though I do a majority of my work on this one.
    eta: The Save for Web dialog is appearing on my MacBook Pro.
    Of course, now I can't get the Loop checkbox to toggle, or the Frame Delay to change for the animated GIF I am trying to create. *sigh* Now I shall start searching the forum for a solution to that problem.
    OK, I just found this:
    Unfortunately this is broken in PSE 6 and PSE 8. You can tab into the frame delay box if you start above it someplace on that side of the screen, and it appears to let you change the rate, but your choice doesn't really affect the actual frame rate. The only workaround is to duplicate frame layers that you want to stay onscreen longer (so it will be changing just as fast, but not visibly).
    Seriously? This is the MAIN REASON I bought PSE. To do animated GIFs. I can't believe that Adobe isn't bothering to fix this problem.

  • Is there a fix for iTunes not running under Windows 8.1 Operating System?

    I used iTunes for Windows, on my Dell Tower PC, successfully under Windows 7 to import CD tracks and share them with my iPad and iPhone using iTunes Match but since I upgraded my operating system to Windows 8 and then 8.1, iTunes for Windows will not run, despite my downloading the latest versions as they become available; I receive no error message!

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    You could also try working through
    TS1717: iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    tt2

  • Password for iCloud not working on Mac / working on iPhone

    iTunes forced change of password to my account, once i did the iCloud pref on Mac will not accept new password?

    Your iTunes account isn't anything to do with iCloud, you should continue to use the ID and password that you have always used for your iTunes account.

  • Xcode Tools will not update under Mac OS X 10.7

    After upgrading to Mac OS X 10.7 on a new Mac Mini, I attempted to update my other software thru the App Store.  When I attempt to update Xcode I get the following message: "Xcode 4.0.2 requires Mac OS X 10.6 Snow Leopard.  Install the Xcode Tools version that supports Mac OS X 10.7 Lion."  I can find no update on App Store that will accomplish this task.  The one entry in App Store I can find for Xcode just attempts to install and produces the message above.  How do I get the lastest version?

    I figured out what MAS was minute or two ago... after searching over and over at apple.com in the downloads section and finding more than 150 hits at one time, nothing for xcode AND download AND lion (and also substituting 10.7 instead of lion). None of the 150 hits dealt with xcode itself.
    Another search for xcode (all by itself) came up with 4 items only talking about webobjects.
    It wasn't until I finally went to the main apple page, clicked on Mac, at the bottom Developer -> Mac Program, then at the bottom, XCode 4 developer preview, then I finally found "View in Mac App Store" (so I found out what MAS was).
    When I clicked the View link, Lion had to be told what app it should use to view the page!
    My download is apparently done now, so I think I'll go install it.
    What a chore! Had I been thinking, I could have just started up the app store from my dock! (I don't think I did that with Snow Leopard... which was another arduous project.) I rarely use the app store. I spend more time trying to figure out how to use what I've already got!
    Do I need to uninstall my xcode 3.x first or will it just be replaced?
    Thanks for the reply.

  • AddListener property for ChoiceBox not working in MAC !!!

    The following piece of code is working fine in Windows but not in MAC. Any idea?
    cb.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
    @Override public void changed(ObservableValue<? extends String> selected, String oldValue, String newValue) {
    if(!oldValue.equalsIgnoreCase(newValue))
    refreshScreen();
    Thanks in advance !!!

    There are some issues with combo boxes/choice boxes. Probably this can be of some help:
    http://javafx-jira.kenai.com/browse/RT-23876?focusedCommentId=277530&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-277530

Maybe you are looking for

  • Search results sorting

    hello , I would like to have a custom control that sort search results  ( A to Z or Z to A ), so , i created a dropdownlist with two entry : A-Z  et Z-A. When user click A-Z , i would like that search results display in the right alphabetic order fro

  • Unicode character

    what is the unicode character for space? Is there one? if (letter == ' ') {     //do something }I test here the char letter to ' ' (space) but it doesn't go into the the if even though the char letter is equal to space or ' '. So is there a unicode c

  • My Video shakes from side to side in Windows Media Player is this caused by the stabilization effect

    I have recently saved some of my video's in the format "MPEG HD 720P 30" and when I play them with windows media player is does not go full screen it has the two black bars on the sides and at certain points in the video the sides will shake right to

  • How can we report on R/3 tables using SAP BO

    How can we report on R/3 tables using SAP BO. Thanks

  • In HR Module PA30

    Dear all, I want to restrict PA30 t-code for some of the user . Is there any solution for this? Manas