Problems with tables of Menus and Menu items

The short story's I am a graphic interface for application design, it has a lot of menus and menu by menu items.
I thought as in normal Java, I could simply do an array of Menus and many of the menu items. My problem is that it compiles fine, but spreading tons of exceptions. I use Netbeans as my IDE.

Here is a sample of my code. Is not all that, but that's the part I have printing has problems since he worked before moving to tabular form.




[Menus] Menu = Menu new [11];
menus [0]. SetText ("file");
File [] = new MenuItem MenuItem [8]; DEFINITIONS FROM FILE MENU


file [2]. SetText ("Open"); Open
file [2] .setOnAction (new EventHandler < ActionEvent > () {}
@Override
{} public void handle (ActionEvent arg0)

Element 'FileChooser' fc = new FileChooser();

File = fc.showOpenDialog (primaryStage);

}
});

leader [2] .setAccelerator (null);



menus [0]. GetItems(). AddAll (file);

Menu bar bar of menus = MenuBarBuilder.create)

. Build();




menubar.getMenus () .addAll (menus);


VBox vbox1 = VBoxBuilder.create)
. Children (MenuBar, scrollPane1, BTN)
. Build();


ap.getChildren () .addAll (vbox1);


in any case the stuff compiles fine without error. But Netbeans spit exceptions as a guy who ate a bottle of ipecac and the bombs of programs.
Here are some of them.

Exception in the method of Application startup
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.javafx.main.Main.launchApp(Main.java:642)
at com.javafx.main.Main.main(Main.java:805)
Caused by: java.lang.RuntimeException: Exception start Application, method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
to com.sun.javafx.application.LauncherImpl.access$ 000 (LauncherImpl.java:47)
to com.sun.javafx.application.LauncherImpl$ 1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
to javafxapplication2. JavaFXApplication2.start (JavaFXApplication2.java:37)
to com.sun.javafx.application.LauncherImpl$ 5.run(LauncherImpl.java:319)
to com.sun.javafx.application.PlatformImpl$ 5.run(PlatformImpl.java:206)
to com.sun.javafx.application.PlatformImpl$ 4.run(PlatformImpl.java:173)
at com.sun.glass.ui.win.WinApplication._runLoop (Native Method)
in com.sun.glass.ui.win.WinApplication.access$ 100 (WinApplication.java:29)
to com.sun.glass.ui.win.WinApplication$ $3 1.run(WinApplication.java:73)
... 1 more
Result of Java: 1

I don't really know what to do. I would like some recommendations.
If possible I would still use arrays of Menus and Menu items, but if this is not possible, I would like to know and understand why not.

(Sorry, that swapped with your previous message).

You have a NullPointerException because you try to reference menus [0] when it has not been initialized:

Menu[] menus = new Menu[11] ;

creates a reference to an array of 11 Menus, but not initialize them. So, each element of the array is null.

menus[0].setText("File");

throws a NullPointerException you are trying to call a method via an object reference (menus [0]) that is set to null.

You need

Menu[] menus = new Menu[11];
menus[0]=new Menu();
menus[0].setText("File");
// or just replace those two lines with menus[0]=new Menu("File");

and similarly, no doubt, for all other elements in the menus array.

You have problems similar to sets of menu items.

Edited by: James_D October 31, 2012 12:00

Tags: Java

Similar Questions

  • problem with the Finder - files and folders displaying incorrectly

    After acquiring a new iMac, I noticed a problem with the Finder - files and folders are displayed wrong (see table).

    This is what happens always after the files have been transferred from one folder to another. I was reminded of my days of using Mac OS in the 1980s when automatic setting of files was not so "automatic." I use Mac OS for decades and I don't remember the last time I had to think about GUI problems like that.

    Other problems in the graphical display of files and folders were introduced, such as when you have hundreds of files in a single folder, you end up deleting about 30 to 40 of them say in a particular section, and you end up with gaps of the ChartSpace where files used to be, that is the remaining files automatically rearrange themselves (fill in these gaps) - never. A week later, you open the folder, and the gap of GUI is still there.

    I decided to do a clean install of the operating system but nothing works.

    Is there some setting in Prefs I'm missing?

    Hi there highland99,

    Looks like your folder icons are not accommodating themselves automatically you plan to do. To me, this indicates that you have organize by the None value in the view menu. You can change the way files and folders are prepared automatically by clicking on view > reorganize by and selecting how you would like that fixed.

    Thank you for using communities of Apple Support.

  • Problem with shutdown on the start menu

    Original title: PROBLEM WITH SHUT DOWN IN STAT MENU

    I had a problem with closing down on the start menu in my dell Inspiron CORE i3 laptop with windows 7. When I right click on the command prompt, and the user has clicked run as administrator nothing came, and now I can't click on anything whatever in the menu tab start such as my documents, my computer and Control Panel. Please tell me how to solve this problem. for this reason I can't tab from the command prompt.

    Hello

     
    Thanks for the reply and happy to know that the problem has been resolved.
     
    If you have problems with Windows in the future, please do not hesitate to post in the Microsoft Community Forums and we will be happy to help you.
  • Hello, I have a problem with Mozilla Firefox 14 and now also Firefox 15. When I click on .html files on my desktop, firefox will open a new window twice. Where is the th

    Hello, I have a problem with Mozilla Firefox 14 and now also Firefox 15. When I click on .html files on my desktop, firefox will open a new window twice. Where is the problem? Thank you

    That may be a problem with the DDE.

    Try to undo and redo Firefox as default browser.

    Make a different browser like IE browser by default and then let Firefox do it again.

    See:

  • Are there problems with Firefox 5.0 and 1Password 3.6.1?

    I started to update to Firefox 5.0 and noticed a message that the 1Password version I had at the time would not work with Firefox 5.0.
    Are there problems with Firefox 5.0 and 1Password 3.6.1?

    They say you need 1Password 3.6.0 or later to work with Firefox 5.0

    http://Forum.agile.WS/index.php?/topic/5319-Firefox-5-requires-1Password-360-or-later/

    http://help.agilebits.com/1Password3/firefox.html
    
  • Someone at - he had problems with 9.2.1 and pairing Bluetooth devices?  My iPhone will not be connected or pair of devices.  Devices to recognize the iPhone 6, but the will of the iPhone 6 does not recognize the device.  Is there a problem with 9.2.1?

    Someone at - he had problems with 9.2.1 and pairing Bluetooth devices?  My iPhone will not be connected or pair of devices.  Devices to recognize the iPhone 6, but the will of the iPhone 6 does not recognize the device.  Is there a problem with 9.2.1?

    Kev2012 wrote:

    Someone at - he had problems with 9.2.1 and pairing Bluetooth devices?  My iPhone will not be connected or pair of devices.  Devices to recognize the iPhone 6, but the will of the iPhone 6 does not recognize the device.  Is there a problem with 9.2.1?

    It would depend on what you're trying to link to?

    Here are the supported Bluetooth profiles an Apple device can connect to iOS: Bluetooth profiles supported - Apple Support

  • Equium L10: Problem with the main battery and battery RTC

    Hello

    I have the Toshiba Equium L10 and it is about 14 months old and I have problems with the battery and how much time it takes after a full charge. I also have problems with the RTC battery and an ERROR 0271: check date and time settings message when I turn on the laptop.

    Regarding the battery, I can fully charge it upward in about 3 hours, but when I start to use it, apparently in the last few hours around one and a half or so and then it needs to be recharged. I can have down for about 40 minutes and then turn it off and come back later or in a day or two. How long should I expect from a fully charged battery?

    About the batttery RTC, it really becomes a pain and I only started to get the message of the ERROR 0271 start-up, in recent weeks. I can charge the battery pack and then leave for a few days, but when I turn it on, I get the message ERROR 0271 on the date and time incorrect. Surely after a full charge, the RTC battery should last longer than a few days?

    The manual says that if the RTC battery is exhausted or becomes weak, you must charge the battery of the CCF for 24 hours, in a different part of this manual indicates between 24 and 48 hours, but how can load you for long when the sections concerning the charging battery pack status after charging the battery you unplug the power adapter because leaving connected will shorten the life expectancy of the Battery Pack. So, how we can charge the battery of the CCF for 24 to 48 hours if we shouldn't leave the AC adapter plugged in once the battery is charged - which is nearly three hours. Suggestions about these problems would be appreciated.

    Besides we all know that it is easy to change the CMOS/RTC battery in your desktop base unit, but is it easy to change in a Toshiba Equium L10?

    Concerning

    Brave0

    Hi Brave0,

    The normal recommendation for the CMOS (RTC) battery is to leave the laptop connected to the power supply at least 12 hours when the main battery is fully charged. The charging circuit is going to hijack the current to the load automatically RTC battery and no current will be forwarded to your main battery.

    Recommendation do not leave the power adapter is plugged in the main battery is fully charged is really only applicable to older laptops that used no batteries Li - ion and therefore they had to be completely discharged before recharging to avoid any effect 'memory' of the battery.

    With modern Li-ion batteries, it is quite safe to leave the battery when fully charged and still power the laptop from the AC adapter. The charging circuit will pass all the battery charge if it is fully charged.

    Kind regards

  • There is a problem with my payment information and I can't configure any application I want to remove my information from my icloud account payment

    There is a problem with my payment information and I can't configure any application I want to remove my information from my icloud account payment

    There are no withdrawal, must be replaced and released.

  • I'm having a problem with Windows7 Home Premium and WWII CFS joystick operation. I get a message saying that the controller has been changed. Microsoft offers a patch?

    I have problems with Windows7 Home Premium and WWII CFS joystick operation.  I get a message from gibberish, saying that the controller has been changed.  I tried to replace the file with a version of Windows XP .cfg and also tried to re-write the .cfg file.  Apparently, this version of Windows will not allow a file to be saved with an extension ".cfg", so it does not work either.  Any suggestion would be appreciated.

    Thank you

    Hi Bob,

    You can consult the following links of wire and check if it helps.

    Joystick does not work with the Europe of WWII Combat Flight Simulator series. Help?

    With the help of WW2 Europe Combat Flight Simulator series with Windows 7 Home Premium

    Note: The above links contain third party links. Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • Problem with Quicken 2012 House and the company after installation, runtime error

    I have a problem with my Quicken home and business 2012. I upgraded from 2009 to 2012 and was able to use the new version for about 1 hour, but he hung a little.  Now when I tent to access my Quicken program, I get a runtime error "program: C:\Program Files\Quicken\qw.exe ' abnormal program termination. Quicken is then stopped immediately.  I am currently running Windows XP service pack 3.  Any suggestions?

    Hi RENEE HETTERLY,.

    I suggest that you uninstall and reinstall Quicken program on the computer, check to see if it helps.

    How to change or remove a program in Windows XP

    http://support.Microsoft.com/kb/307895

    If the previous step fails, then you will need to contact Quicken support for assistance.

    http://Quicken.Intuit.com/support/Windows.jsp

  • Having a problem with a redirect virus and the refusal by the system to allow me to download various things, Windows Live Mail in particular.

    I recently tried to remove malware on my Vista based laptop Toshiba.


    I recently tried to remove malware on my Vista based laptop Toshiba. Malwarebytes helped, but I still have problems with a redirect virus and the refusal by the system to allow me to download various things, Windows Live Mail in particular. I tried to download from a copy of the USB stick to a clean computer, but he still refuses to load telling me to check my internet connection, which is fine for general use. Please help I get crazy and do not forget that I am a pure layman - thank you if you can help - Kidso

    I found that the best place to ask this type of question is here: -.

    http://forums.ComputerActive.co.UK/forumdisplay.php?f=20

    There are some very good people out there who helped me (successfully) on 2 occasions.

    Good luck.

    I'll be interested to know how you go.

  • Problems with media player 11 and all other players, playing music is broken?

    Problems with media player 11 and all other players, playing music is broken?

    Hi all

    I have a big sound even and odd / problem reading music?

    My computer using windows media player 11 and classic media windows and others to play my music in the hard lists recorded by windows media player 11 copied from my CD.

    But here's the weird problem that only started to happen now, when I play music saved on any one of the players of the computer the sound breaks sometimes but not always?

    Even if I try tp use players like windows media player 11 to play recorded video clips sound breaks toward the top, but the video image only?

    I have a newly completed with windows xp home system and service pack 3, and all memory and material necessary for a pc game of level, a new graphics card was installed and by the way the problem of noise was there before this was done?

    I don't know what is the fault? And I don't know how to find out what the required audio driver are for his computer system I?

    I tried the right click on the audio device to see if the pilot could be updated in case that's all? All he asks is a cd or a floppy disk, but I thought you could ask to search for drivers online too?

    He even now breaks the game sounds too!

    Help, please

    If you access Windows Update (start - programs - Windows Update), you can
    see if there is a newer driver. The drivers are optional updates are not so made
    automatically.
     
    Download the driver for your audio hardware manufacturer (or motherboard if
    "It's built-in sound). They are often newer than Windows Update.
     
    This explains how to disable the improvements.
    http://Windows.Microsoft.com/en-us/Windows-Vista/how-do-I-stop-my-music-from-skipping-or-breaking-up-when-I-play-it
     
     
     
    --
    ..
    --
    "zorkspacer" wrote in message news: 9bd0240a-60ba-4186-a47f-38d6b3f88ddb...
    > Problems with media player 11 and all other players, playing music is
    > broken?
    >
    > Hi all,
    >
    > I have a big sound even and odd / problem reading music?
    >
    > My computer using windows media player 11 and windows classic media and
    > others to play my music in the hard lists recorded by windows
    > media player 11 copied from my CD.
    >
    > But here's the weird problem that only started to happen now when I
    > play music saved on any one of the players of the computer sound
    > breaks sometimes but not always?
    >
    > Even if I try tp use players like the windows media player 11 to play
    > saved video clips, sound breaks toward the top, but the video image only?
    >
    > I have a newly finished system with windows xp and service pack 3 home, more
    > all the memory and the material necessary for a pc level game, new graphics
    > card has been installed, and by the way that the noise problem was there before
    > who did?
    >
    > I don't know what is the fault? And I don't know how to find out what the
    > driver needed sound are for his computer system I?
    >
    > I tried the right click on the audio device to see if the driver could be
    > update in the case where that's all? But everything he asks a cd or a floppy disk, but I
    > thought you might ask it to search for drivers online too?
    >
    > It even now breaks the game sounds too!
    >
    > Please help
    >
     
     
  • Problems with the video card and sound card on Toshiba model #PSLCOU - 02701G

    I bought a new laptop in 2009, and it is a Toshiba, model #PSLCOU - 02701G. After about three months the video card and the sound began to spoil. It's what he does, I can go on U-tube or any web site that has a video to watch like CNN news, etc. What it does is it starts to play and the video and the sound is good and he paused for a few seconds and starts again, new breaks and pauses, starts, pauses, starts. He does it all the time, and I was wondering if you all have any idea whats going on? Help? Help?

    It really sucks when you try to watch the news. Also, I put a CD or DVD into the laptop and it works perfectly. I can watch any DVD or listen to a GREAT Cd.

    How is your network connection?  Sometimes, the system needs to create a cache to store the downloaded information and if the download is not pass quickly enough the system will freeze while wiaiting for download to catch up - not a problem with your sound cards and video, but with the speed of Connection on the website or on the network itself (or your network equipment).  This looks like the case if the DVD and the CD's works fine.  Check your internet connection and try to download the video pages to see if the problem is with all the downloads, or only those on a site.  You can contact your ISP and have them help check you connection and settings and the modem for problems or changes, you can do to improve things. Sometimes happens to me as well in the internet connection runs slower than normal and there is nothing that I can do but wait to accelerate - and it's frustrating.

    You can get in trouble with your device drivers.  Go to the Device Manager by going to start / find and type Device Manager and enter and then double-click on the program icon that appears.  Check each device to a red x, yellow! or white?  These identify devices with problems probably (drivers, but also of conflict or something else).  Click on each for more details and troubleshooting tips.  If you need to get the drivers (and you need you to do all you have time to do, but at least the network card, sound card and video card - they can help way beyond simply solve this problem), get the computer dealer or the manufacturer of the device (NOT of Microsoft Updates).  In fact, you must disable automatic updates in Windows Update driver as follows: http://www.addictivetips.com/windows-tips/how-to-disable-automatic-driver-installation-in-windows-vista/. Follow these steps to get the drivers: http://pcsupport.about.com/od/driverssupport/ht/driverdlmfgr.htm.  Once you have the drivers, you can install them via the Manager device as follows: http://www.vistax64.com/tutorials/193584-device-manager-install-driver.html.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Problems with the Precision M4400 and the graphic card Nvidia quadro 770M

    I have a problem with my Precision M4400 and Nvidia Quadro 770 M. After I installed Windows 7 64 bit, I have problems with the graphics card. I get a blue screen or graphic errors. I tried several versions of the driver. In the Nvidia forum had this problem even more. Here, they told me that only a BIOS update for the graphics card to solve the problem. Update the BIOS, but I should refer by DELL. So my question is this problem with Dell is also known, and there is already an update of the BIOS to the Quadro 770 M?

    Hi all

    I have the solution by chance. I was looking for the latest drivers GeForce for Windows 7 x 64 and I read the accompanying note: http://fr.download.nvidia.com/Windows/337.88/337.88-win8-win7-notebook-release-notes.pdf
    On page 17, you can read the following note to fix: "[GeForce FX 770 M] [portable]: blocking of the blue screen occurs after Windows starts."

    Of course, GeForce FX 770 M does not exist (and never was), and it should be Quadro FX 770 M. I can bet that nVidia has corrected this famous BSOD problem in the wrong driver because always there is nothing about any "Quadro FX 770 M - fix" in the note accompanying the latest Quadro (340.52) driver.

    You try the GeForce driver above, but to install it, you may need to download an INF file modified with the addition of the ID of Quadro FX 770 M (= "NVIDIA_DEV.065C ="NVIDIA Quadro FX 770 M"). Try without the first modified INF file because the Quadro FX 770 M is listed as a compatible chip in the version of the driver GeForce 337.88 note...

    I'll try that, even though I am completely sastified with the latest driver for Quadro (feasible) (285.62) without disable Powermizer. I did not try the latest Quadro drivers again (to be honest).

    Late me know please.

  • I started having problems with the wireless mouse and the carpet of my laptop - Lenovo ThinkPad T420 mouse.

    Original title: right click on the mouse itself activating

    I borrowed a USB to a person at work and I started having problems with the wireless mouse and the carpet of my laptop - Lenovo ThinkPad T420 mouse. The left click of two devices works normally, however, sometimes she does not respond to clicks and it takes a few seconds to work. The left button was constantly starts to turn on, as if he was stuck. After that I hit Alt + Tab and modify windows it stops for a few moments and starts at a later date. I havo not found a specific condition or a combination of keys that may trigger the fault.

    I read a few posts on discussion forums, but all say that it could be a hardware problem, which I think is not, because both devices have the same problem and I'm sure it all started with the insertion of the borrowed memory stick. I scanned the readers to help Symantec's EndPoint Protection and installed Microsoft Security Essentials and performed a full scan, but found nothing. I even restored the system, but the problem remains.

    Should I get a different antivirus? How can I find the cause so I can find a better targeted solution?

    Try to install the drivers from this link and check.

    http://support.Lenovo.com/en_US/research/hints-or-tips/detail.page?&LegacyDocID=MIGR-77167

Maybe you are looking for