Results 1 to 8 of 8
Thread: I'm desperated with NetBeans IDE
- 03-04-2011, 08:58 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 14
- Rep Power
- 0
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)
This is the code in the FenetrePrincipale that is not working no more but has worked at home and in class last weekJava Code:btproject.FenetrePrincipale NotreFenetre=new btproject.FenetrePrincipale(); NotreFenetre.setVisible(true);
When putting a breakpoint in the this method, it never step on !!Java Code:private void jMenuAboutMouseClicked(java.awt.event.MouseEvent evt) { APropos AProposPopUP=new btproject.APropos(); AProposPopUP.setVisible(true); }
If someone could explain what is happening... it would be nice !!
- 03-05-2011, 12:01 AM #2
Member
- Join Date
- Mar 2011
- Posts
- 14
- Rep Power
- 0
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...
- 03-05-2011, 05:35 AM #3
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
- 03-05-2011, 07:55 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,417
- Blog Entries
- 7
- Rep Power
- 17
- 03-05-2011, 12:08 PM #5
Member
- Join Date
- Mar 2011
- Posts
- 14
- Rep Power
- 0
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...
-
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.
- 03-05-2011, 12:12 PM #7
Member
- Join Date
- Mar 2011
- Posts
- 14
- Rep Power
- 0
- 03-05-2011, 12:13 PM #8
Member
- Join Date
- Mar 2011
- Posts
- 14
- Rep Power
- 0
Similar Threads
-
netbeans
By makeachange in forum New To JavaReplies: 4Last Post: 07-31-2010, 02:28 PM -
netbeans
By Nishanthi in forum New To JavaReplies: 11Last Post: 10-02-2009, 09:29 AM -
cannot run web app with Netbeans
By CirKuT in forum New To JavaReplies: 5Last Post: 10-28-2008, 03:48 PM -
NetBeans 5.5
By Ry4n in forum NetBeansReplies: 3Last Post: 01-26-2008, 06:09 AM -
NetBeans 5.5.1 Help.
By padutch2 in forum New To JavaReplies: 6Last Post: 12-03-2007, 03:01 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks