I have created new java application on Netbeans by pressing create new project and it creates java package. This fully fine ! When I add new JFrame it creates and automatically MAIN METHOD , after I am done with Matisse I mean putting some gui components , I want to add JDialog to that , I go on package right click and create JDialog Form which also created MAIN METHOD as well so itself. So both MAINS mixes up. this is confusing me all the time. My Aim is to create JMenuItem called new , when I click on it I want my JDialog to be appear and something like project creation dialog. Help please ! How to combine to different components in these situations ?
Regards
I'm not so sure what is so confusing. Your program should only have one launching class with a
mainmethod. Netbeans will create amainmethod for you inJDialogforms, so just delete themainmethod. The onlymainmethod you need is your mainJFrameform.You have your
JDialogformYou have your JFrame form with
JMenuItem. Add a listener to theJmenuItemto open theMyDialogWhat does that even mean?
Side Note