Show arrow in top JMenu

The problem is that for top JMenu object there is no way to turn arrow on. Here is simple example:
import javax.swing.*;
public class A extends JFrame
public A()
     super("Test");
     JMenuBar bar = new JMenuBar();
     JMenu menu = new JMenu("menu1")
//     public boolean isTopLevelMenu()
//          return false;
     JMenuItem item = new JMenuItem("subitem");
     menu.add(item);
     bar.add(menu);
     setJMenuBar(bar);
public static void main(String args[])
A a = new A();
a.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
a.pack();
a.setVisible(true);
In this example, JMenu object is top level and is shown without arrow. If I overload the isTopLevelMenu then MenuSelectionManager doesn't work anymore and JMenu object doesn't show popup window anymore. How to overcome this? Probably somebody aware about "right" solution? Thanks in advance.

Hi Vadik,
I wanted to do something similar recently, and noticed your post. After a bit of stuffing around creating UI (that didn't quite work!), I ended up using this simple work around:
import javax.swing.*;
public class A extends JFrame {
     public A() {
          super("Test");
          JMenuBar bar = new JMenuBar();
          JMenu menu = new JMenu("menu1");
          menu.setIcon(UIManager.getIcon("Menu.arrowIcon"));
                menu.setHorizontalTextPosition(JMenu.LEFT);
          JMenuItem item = new JMenuItem("subitem");
          menu.add(item);
          bar.add(menu);
          setJMenuBar(bar);
     public static void main(String args[]) {
          A a = new A();
          a.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
          a.pack();
          a.setVisible(true);
}This might not be what you want, but it works for me!
-Muel

Similar Messages

  • I'm wanting to use the "Actions" in Photoshop Elements 11.  But when I get the Actions box up, it is only showing a small list of effects to use.  And no side bar to go any further.  When I click on the little arrow at top and then click on "load actions"

    I'm wanting to use the "Actions" in Photoshop Elements 11. But when I get the actions box up, it is only showing a small list of effects to use. And no side bar. So I can't go any further.  When I click on the little arrow at top and click on "load actions", I am only getting a box with empty space saying "No items match your search".  The folder at the top does say "Actions".  How do I get more effects?  The tutorials that I've checked into all show a long list of effects in their box.  Can anyone help? 

    To use the existing actions, try the following:
    1. Open one of the Action Sets, in this example Special Effects is the Action Set, by pressing the small arrow beside the set name.
    2. Then click on the name of the Action, in this example Faded Ink is the Action name.
    3. Then press the Play button to run the action.

  • How do I turn off the auto-scrol​ling Icon (gray bar with arrow at top and bottom)

    When reading and scrolling this gray bar with arrows on top and bottom shows uunder my curser, the next thing I know I am at the bottom of the page, it is driving me nuts please help. Playing games is almost impossible. Hate it.

    What mouse/drivers do you have? and what browser are you using?
    laptops- ex satillite l755-s5353 inspiron e1505 desktop dimension 400/300

  • I am not able to open my 'system preferences' it shows up on top, but the window just won't open. I haven't installed anything new, I have also restarted my computer, but still encounter this problem. Help?

    I am not able to open my 'system preferences' it shows up on top, but the window just won't open. I haven't installed anything new, I have also restarted my computer, but still encounter this problem. Help?

    Reinstall Lion, Mountain Lion, or Mavericks without erasing drive
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu.
    Reinstall Lion, Mountain Lion, or Mavericks
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
    OS X Lion- Reinstall Mac OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

  • Organiser in PSE8 only shows arrow for file . edit etc

    In PSE 8 organiser i
    t only shows down arrow for top File , edit etc. Can I show it the same as editor.

    http://www.johnrellis.com/psedbtool/photoshop-elements-faq.htm#_Setting_the_Windows

  • I have 3 iTunes libraries on my one one computer and since I updated to the new version I can no longer see who's library I am in. It used to show at the top of iTunes the name of the library I was in.  Is there a way I can tell which library I am in?

    I have 3 iTunes libraries on my one one computer and since I updated to the new version I can no longer see who's library I am in. It used to show at the top of iTunes the name of the library I was in.  Is there a way I can tell which library I am in without closing and reopening?

    No. Frequently the apps take up more storage space on the iPod that the file download size.

  • How can you make your persona show on the top and bottom? Also can you make it bigger at the top to show more of the picture?

    How can you make your persona show on the top and bottom?
    Also can you make it bigger at the top to show more of the picture?

    Add extra empty toolbars if you want to see more of the persona.<br />
    You can create extra toolbars to get extra space via View > Toolbars > Customize<br />
    You have to put something on a toolbar (drag a Space item onto it) before closing the Customize window because empty toolbars are automatically removed.<br />
    See http://kb.mozillazine.org/Toolbar_customization

  • My events photo albums have all been renamed with a number followed by IMPRT instead of the date which was how they were originally named. Also the photo now showing on the top of each folder is not actually in that folder. How do I restore?

    My events photo albums have all been renamed with a number followed by IMPRT (deleting the date on which they were taken) Also the photo now showing on the top of each folder is taken from a different event and so is not actually in the album it is sitting on top of. This happened when I linked to itunes. Any idea how to restore it to how it looked before?

    One thing that I find odd is that iTunes used to rebuild the .itl file when you deleted it.  It seems as if the newer iTunes somehow broke this old capability.  If you delete the .itl file it can't rebuild it- it simple treats this as if this is a fresh installation and completely ignores the fact that the .xml file has all the data in it.  I think Apple needs to bring back this old "feature".  Of course, the negative with that was that you lost all of the "Date Added" info along with some other stuff but at least it still kept the favorites info etc. (and I think maybe even the path although I don't believe I ever tried that because my account path has never changed until now).
    One side note: I can't find where the iTunes Windows SDK is.  I was hoping to try to use that to access the .itl "database" and write a utility to fix this situation.  Seems like this has moved from its original location...

  • What is this Labview function block ? (-1 gain figure with red arrow on top)

    Hello all,
    I came across this code which has a function with -1 gain figure with red arrow on top ? 
    What is this function and where can I find it ?
    Thanks

    decrement ptbypt

  • Curvy arrows at top of podcast page

    while playing podcasts,curved arrows at top of page that turn blue when tapped,but nothing else happens.what is their function,how to use them?

    These are your shuffle controls. They won't do anything on a single podcast - they are designed for shuffling tracks on an album. If the one on the left is blue the tracks play in order; if the other one they are shuffled.

  • "show ip flow top-talkers" output question

    Hello all,
    I have a question about the "show ip flow top-talkers" command. The top enry for this 1841 router with a T1 connection is always this line:
    SrcIf            SrcIPaddress    DstIf         DstIPaddress    Pr SrcP   DstP  Bytes
    Se0/1/0       64.32.253.138   Local         71.16.240.14    32 6EB0 306B  2366K
    How do I get more information about this connection? I looked at ip protocol 32 and it says it is the MERIT Internodal Protocol. Also what does the bytes field mean? Is that bytes per second or per "flow"?

    Hello,
      protocol is 0x32 (in hex) = 50 (dec). This protocol is ESP. I assume, this flow is an IPSEC tunnel.
    The endpoint is your device (regarding to dest interface = local). The "Bytes" field means number of
    bytes in the flow. It is not releated to bytes/sec. Please, feel free to contact me if you need more
    information.
    Kind regards,
    Jan Nejman
    Caligare, co.
    http://www.caligare.com/

  • Master Page elements not showing up on top...

    I'm newer to ID and the industry in general...with no prior experience.  Running CS6 on Windows 8.1.  I have existing documents that were shared with me where the master page elements always appear on top, meaning on top of pages or items placed in a document.  Those items are surrounded by a red dotted line, and I cannot edit those in any way, shape or form.  I am working in a new document and all my master page elements have a blue dotted line and do not show up on top of anything no matter what I do and the option to Arrange isn't there.  I know I must be missing a really simple step, but in all of the videos and tutorials I've read and watched, this has never been addressed.  What am I missing?  See images below (added the green box to show an item on the page showing up on top of the master page stuff.)  Thank you in advance for any help you can offer.

    The color is derived from the color code for the layer. You’ll need to go to the master page to edit the items.
    If you that new to ID none of this is intuitive. First, I recommend that you buy Sandee Cohen’s Visual Quick Start Guide. It’s the be beginner book on the market: http://amzn.to/14JHq54
    You may also benefit from some quality time on Lynda.com. This link will get you a one week free trial: http://lynda.com/trial/BobLevine

  • Cannot access my email folders on iPad mini - the arrow in top left hand corner is not available anymore

    arrow in top left hand corner is not available anymore. Can anyone help?

    You should be able to contact Verizon with the account login information, unless you can get the SIM Card back from whoever you gave it to.  The SIM Card tray is on the top left edge of the device.  There is a SIM Card Tray pin that is advisable to use to get the tray to release.  Once it is out, you can swap it.  If you don't have access to your previous iPad, then you should contact Verizon as the data plan may still be active on the previous device.  This is the first iPad I have had with cellular data option included, but that is the way I understand the situation based on having to exchange my new ipad at the Apple Store.  The Genuis swapped the SIM Cards and my data plan was instantly (after a restart) active on the new one.

  • Can I get something to stop showing up in "Top Sites"?

    There's a web page that keeps showing up in "Top Sites" when I open a new tab that I would rather now have showing. Is there a way to get rid of it?

    HI,
    How to Edit TopSites
    Carolyn

  • Pb g4 disk wont show on desk top will not eject

    pb g4 disk wont show on desk top will not eject

    Resetting of PMU yielded no success.
    Here is what I have tried so far.
    * First try the normal methods to remove the disc. Drag its icon to the Trash can in the Dock or select 'Eject' from the File menu.
      no icon located on desktop
    * If you are running a virtual machine, e.g. VMFusion, ensure that the CD is disconnected from the virtual machine. This will sometimes allow the CD to now show up in Mac OS X.
      mute point for me
    * Shut down the computer and start up whilst holding down the mouse button. This may take some time, but keep your finger on the mouse button right up until the disc comes out or the log-in screen has appeared.
    did not work
    * If you have Toast Titanium installed on your computer, choose EJECT DISC from the menubar.
    disk did not show up in menu bar to eject
    * Sometimes you can successfully use the eject disc button in iTunes even if the disc is not visible to the Finder
    eject option was available in itunes but no response
    * Open Disk Utility and choose the disc you wish to eject in the left-hand pane, then click on the Eject button.
    disk is not visible
    Some Macintoshes have a paperclip hole that you can insert a straightened paperclip into, manually triggering the eject mechanism
    no orriface thta fits this discription as far as I can tell
    * Restart the computer while holding down Command-Option-O-F, to enter the Open Firmware prompt. Type "eject cd" without the quotes, and press return. The disk ought to eject. To start into OS X, type "mac-boot" without the quotes. Press return, and the computer will continue with the startup. (This will not work on an Intel Mac. There is no Open Firmware on Intel Macs. )
    no luck
    * If your computer has an eject button on the keyboard, restart the computer holding down the Option key. When the startup disk selection screen appears, let go of the option key and press the keyboard's eject button.
    this did not work either
    I can hear disck spinning but dvd player shows the following prompt:

Maybe you are looking for

  • Adobe Media Encoder - AMT Subsystem Error

    When trying to open the application, I get this message: "AMT Subsystem Error Thank you for using Adobe Media Encoder CS6. The Adobe product that installed Media Encoder has not activated. Please launch and activate that Adobe product before continui

  • Iphone 6 won't backup to icloud

    My husband and I upgraded from iphone 4s to iphone 6. We used to share the same apple id, but ran into an issue where a contact would call him but it would appear on my phone was well. It was suggested to alleviate that issue that we should create a

  • NWDS 7.0 Web Dynpro can't run on WAS 6.4

    Dear All, I got a question may be some of you encountered. I am using NWDS 7.0 to develop a web dynpro application and try to run in WAS6.4, however, it prompt the errors "   java.lang.NoClassDefFoundError: com/sap/tc/webdynpro/clientserver/uielib/st

  • Problem with non WLAN internet connection

    I've swapped my simm out from my N95 and installed the provider internet access settings via SMS. The N95 worked perfectly to access internet via 3G, but the N8 just can't make a connection. It looks like the settings are correct. However, whenever a

  • Download remote http file

    Hi! What is the best app for downloading remote http files (in this case large xml's) through my mac, to either my mac and/or another remote server? Thanks!