Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Dialog box using Netbeans

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am developing a Java application and I am using netbeans for the GUI. I have a main window for which I used a JFrame class and I have a menu in that. When the user clicks that menu item, I want a modal dialog to open. I want to have a number of buttons on that dialog to get a "logic formula" as input from the user. Its difficult to manually write code for this dialog box. So I wanted to do this using Netbeans. But I dont know how to create a class for a dialog box in Netbeans. I am able to create another JFrame class. But using this a dialog seems to be problematic since closing that frame closes the whole application.

When I try to add something new to my project, i am given only the following options - Java class, JFrame form, JPanel form, Java Package, Java interface and web service client.

Can somebody explain the process of adding a JDialog as a stand alone class so that I add buttons to that dialog using the netbeans front end and then I can create an object of this class when the user clicks on the particular menu item.

Thanks a lot in advance.

- Easwar
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Easwar,
First of all, get the latest stable release of Netbeans, i.e., version 5.5. If you are already having this version then follow the steps below:

1. Create a new project in netbeans.
2. Go to menu File > New File ( or alternately press Ctrl - N )
3. In the dialog box that appears, notice that in the left hand side you have a list of categories, select Java GUI Forms in the category list.
4. Notice that the right hand list now changes to show you the available form types. You must have a type called JDialog form available in the right hand side list. Select this and press next!
5. Fill in the details in the next page and Voila! The GUI editor of Netbeans called Matisse now opens up for you with the JDialog that you want to create.

Hot dog! An advertiser loves us THIS much:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic