Results 1 to 2 of 2
  1. #1
    X-mac is offline Member
    Join Date
    Dec 2010
    Rep Power

    Default Launch a Jdialog from menů

    Hi everybody, I'm very very new in Java and I would like to implement some project: Now I'm using NetBeans 7, I had just create a simple project with a Main form and 3 JDialog Form.
    In my Main Form I have an Menů with some MenuItem, every menuItem will be launch a Jdialog.
    By Netbeans I can link an action from menů at form, but when i need write code for those action I can't understend how to do.
    I have see the code for the AboutBox action in the menů, I had try to replicate that code, but don't work.
    Someone can help me?

    The code that for Action to show AboutBox
    public void showAboutBox() {
    if (aboutBox == null) {
    JFrame mainFrame = VigiliDelFuocoApp.getApplication().getMainFrame();
    aboutBox = new VigiliDelFuocoAboutBox(mainFrame);
    ---this code work---
    but if i try to copy and past with modify:
    public void showAboutBox() {

    JFrame mainFrame = VigiliDelFuocoApp.getApplication().getMainFrame();
    AnaBox = new VigiliDelFuocoAnagrafica(mainFrame);


    This action don't work

    Tank you for help

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power


    Reading generated code isn't the best, or even a good, way to learn Swing coding. Go through the tutorials instead.
    Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)


Similar Threads

  1. Launch configuration
    By skittle in forum Eclipse
    Replies: 0
    Last Post: 02-28-2010, 11:57 PM
  2. Launch Error
    By roughjj in forum Eclipse
    Replies: 1
    Last Post: 10-30-2009, 07:59 PM
  3. Fill a menu dynamically when menu is shown
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 04:47 PM
  4. React to menu action and checkbox menu
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-27-2008, 07:50 PM
  5. Replies: 7
    Last Post: 05-09-2008, 07:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts