Results 1 to 8 of 8
  1. #1
    soundlord is offline Member
    Join Date
    Mar 2011
    Posts
    14
    Rep Power
    0

    Default I'm desperated with NetBeans IDE

    Greetings !!

    One week ago my students and I have started to devellop a GUI interface with NetBeans IDE 6.9.1.

    In class we created a project "Java application" template and then we started to create the GUI.

    I created a new JFrame form called FenetrePrincipale on which we added a swing menu bar with different items on it.

    I created a new JFrame form called APropos on which we added some JLabel components.

    The first exercice consisted to click on the About menu item and then it must show the Form with the about section. Believe me it worked in class.

    Back to home with the same project I realized that it worked no more !!
    As I changed stuffs in the FenetrePrincipale class I took one student project that worked in class but the issue was the same: it seems that the event MouseClick is not sent to the FenetrePrincipale !! How does it worked before ?

    This is the code in the Main.class to call the FenetrePrincipale (it always worked)

    Java Code:
    btproject.FenetrePrincipale NotreFenetre=new btproject.FenetrePrincipale();
    NotreFenetre.setVisible(true);
    This is the code in the FenetrePrincipale that is not working no more but has worked at home and in class last week

    Java Code:
    private void jMenuAboutMouseClicked(java.awt.event.MouseEvent evt) {                                        
            APropos AProposPopUP=new btproject.APropos();
            AProposPopUP.setVisible(true);
    }
    When putting a breakpoint in the this method, it never step on !!

    If someone could explain what is happening... it would be nice !!
    Attached Thumbnails Attached Thumbnails I'm desperated with NetBeans IDE-probl-mejava.jpg  

  2. #2
    soundlord is offline Member
    Join Date
    Mar 2011
    Posts
    14
    Rep Power
    0

    Default

    Ok, all my apologizes for a java beginner this is the minimum...

    I was confused with the MouseClicked and MousePressed events (what is the major difference ???) and now it work better... I also changed MouseClicked to MenuSelected for the "about" JMenu object.

    I have to check it next week because I'm on Hollydays but I'm quite sure that my students have selected MouseClicked for the JMenu "Apropos" object and it was working... maybe it is because they are using Windows XP the events are handled differently ???

    I'll dig and take an appointment for the next week...

    Thank you anyway...

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default

    You're using the wrong listener, and where did you find a "MenuSelected"?

    Recommended reading:
    How to Use Menus (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)

    Also note that the NetBeans visual designer aka Matisse is an advanced tool, targeted at programmers who are already familiar with Swing. As a beginner, you'll attain better productivity with far less frustration hand-coding your GUIs.
    Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)

    db

    db

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,375
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by soundlord View Post
    my students and I
    You're one of them, right?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    soundlord is offline Member
    Join Date
    Mar 2011
    Posts
    14
    Rep Power
    0

    Default

    I did lot of things in C, C++, but Java is quite new for me and I never did GUI but some Applets using simple objects as Buttons, Checkboxes, ...

    This project is very interesting because the idea came from them, they proposed to learn Java. I accepted as some of the parts of this application match with the educational program I have to follow. That's big !!

    They must learn how to work in a OOPE (they started with Visual Basic but now they are bored with) and this application regroups all the stuff needed to know at the end of the year (in june).

    + Object programming
    + Variable and method ranges, visibility, ...
    + Inheritage, ...
    + Event handling
    + Database connectivity
    + ...

    They wanted to use this application to play music just as Amarok or iTunes...

    I took the challenge... and I'm sure we could do something working good...

    By the way, if someone knows, is there a way to launch the .jar file in a different way than call "java" in Linux or Windows ? Is there a way to make it executable for Linux and Windows x86 ?

    I did not yet dig so much in this way...
    Thank you...

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    In Windows, you need to set up file associations so that when jar file is double clicked, it's called with javaw.exe. Sometimes it's easiest to create a shortcut, especially if you want the jar called with parameters.

  7. #7
    soundlord is offline Member
    Join Date
    Mar 2011
    Posts
    14
    Rep Power
    0

    Default

    Quote Originally Posted by Darryl.Burke View Post
    You're using the wrong listener, and where did you find a "MenuSelected"?
    In the Events tab when I select the Menu "APropos"...
    Now the behaviour matches with my expectations...

    Thank you for the links, I'll read them and try to learn better way to make it work... ^^

  8. #8
    soundlord is offline Member
    Join Date
    Mar 2011
    Posts
    14
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    In Windows, you need to set up file associations so that when jar file is double clicked, it's called with javaw.exe. Sometimes it's easiest to create a shortcut, especially if you want the jar called with parameters.
    Yes that is what we are doing from now... I was thinking there was a better way from command line...

Similar Threads

  1. netbeans
    By makeachange in forum New To Java
    Replies: 4
    Last Post: 07-31-2010, 02:28 PM
  2. netbeans
    By Nishanthi in forum New To Java
    Replies: 11
    Last Post: 10-02-2009, 09:29 AM
  3. cannot run web app with Netbeans
    By CirKuT in forum New To Java
    Replies: 5
    Last Post: 10-28-2008, 03:48 PM
  4. NetBeans 5.5
    By Ry4n in forum NetBeans
    Replies: 3
    Last Post: 01-26-2008, 06:09 AM
  5. NetBeans 5.5.1 Help.
    By padutch2 in forum New To Java
    Replies: 6
    Last Post: 12-03-2007, 03:01 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
  •