• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Dialog box using Netbeans

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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.

 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic