Java Forum / General / August 2006
How to edit the GUI source code?
cntcltk@gmail.com - 27 Aug 2006 01:18 GMT I download the JAVA source code of a GUI programe and import them into the NETBEANS.I can run the code in the IDE,but I can't edit the interface of the programe.How can I do that?
Just like VB or Delphi:get the source code,import it into the IDE,edit the interface,compile it and run it!
Thx a lot!
Andrew Thompson - 27 Aug 2006 01:42 GMT cntc...@gmail.com wrote:
> I download ... The internet is a big place, care to be more specific? What is the URL of the source package you downloaded?
>...the JAVA source code of a GUI programe and import them into > the NETBEANS.I can run the code in the IDE,but I can't edit the > interface of the programe.How can I do that? NetBeans is sure capable of editing GUI's, (though I detest it and don't use it). But if NetBeans help is not good enough to show you how to edit the source, why not use a different editor?
OTOH - editing source is fairly basic to all IDE's, so if you have a basic misunderstanding about source editing in NB - it might carry straight over to any other editor.
Which brings me back to, exactly what did you download? This can best be explained with the link to the download, but does it contain .java files, .jar files. what?
Andrew T.
Arne Vajhøj - 27 Aug 2006 01:49 GMT > cntc...@gmail.com wrote: >> ...the JAVA source code of a GUI programe and import them into [quoted text clipped - 13 lines] > This can best be explained with the link to the download, > but does it contain .java files, .jar files. what? I strongly suspect that the cause of the problem is that Netbeans only permits you to edit the GUI (typical JFrame classes) via the GUI Builder not by editing the Java code behind it.
Some XML file tells NetBeans what not to allow being edited or something like that (it is a king time since I have last used NetBeans).
Arne
hiwa - 27 Aug 2006 02:43 GMT Arne Vajhøj のメッセージ:
> > cntc...@gmail.com wrote: > >> ...the JAVA source code of a GUI programe and import them into [quoted text clipped - 24 lines] > > Arne That's right. Netbeans can't handle generically written Java source code. Beginner never should use IDE, I firmly believe.
Andrew Thompson - 27 Aug 2006 03:06 GMT > Arne Vajhøj のメッセージ: > > > cntc...@gmail.com wrote: [quoted text clipped - 4 lines] > > > NetBeans is sure capable of editing GUI's, (though I > > > detest it and don't use it). ...
> > I strongly suspect that the cause of the problem is > > that Netbeans only permits you to edit the GUI > > (typical JFrame classes) via the GUI Builder not > > by editing the Java code behind it. What?!?
That sure explains a problem I ran up against recently.
There is a project I am involved in, that was developed in NetBeans. The GUI was (of course) developed in the 'Form Editor'. As it happens, we needed a change in the GUI and the project owner 'strongly suggested' the changes be done in the NB form editor.
I did the changes, but since looking at NB makes me want vomit - I ducked into Eclipse and (shock horror) edited the 'actual Java code'.
We now have a working version of the GUI, though the negotiations to get it integrated into the project will be ..interesting.
And to the OP - I think Hiwa had the best advice - neither Eclipse nor NetBeans is a tool well suited to learning Java. They offer very advanced abilities, but get in the way of getting simple things done, as you have just experienced.
Andrew T.
David Segall - 27 Aug 2006 14:40 GMT >There is a project I am involved in, that was developed in >NetBeans. The GUI was (of course) developed in the [quoted text clipped - 5 lines] >me want vomit - I ducked into Eclipse and (shock horror) >edited the 'actual Java code'. Andrew, I am genuinely shocked and horrified! I regard this as roughly equivalent to being asked to modify a Delphi program and converting it to "proper" Pascal.
I hope that Sun produce a standard for representing GUI forms and it seems that annotations may be the way to do that. However, until that happens we don't have Java programs. We have NetBeans programs or JBuilder programs or JDeveloper programs and if I want something changed in a project I would expect the maintenance programmer to stick to the original "language".
Andrew Thompson - 27 Aug 2006 15:42 GMT ...
> I hope that Sun produce a standard for representing GUI forms and it > seems that annotations may be the way to do that. However, until that > happens we don't have Java programs. We have NetBeans programs or > JBuilder programs or JDeveloper programs ??? I write Java programs. Some of them have GUI's, some don't. Some use the standard Sun Layouts exclusively, others include custom layouts, while still others override paint() and just go beserk. These Java programs can be built using Eclipse or NetBeans, or ..the standard SDK tools from the command line.
>...and if I want something > changed in a project I would expect the maintenance programmer to > stick to the original "language". I 'speak' Java, not 'NetBeans'. ..
Andrew T.
David Segall - 27 Aug 2006 16:30 GMT >... >> I hope that Sun produce a standard for representing GUI forms and it [quoted text clipped - 8 lines] >Eclipse or NetBeans, or ..the standard SDK tools from the >command line. OK. I got a bit carried away in my post and, of course, you can develop a Java system in any way you choose. I was not trying to argue that you must select an IDE.
>>...and if I want something >> changed in a project I would expect the maintenance programmer to >> stick to the original "language". > >I 'speak' Java, not 'NetBeans'. .. Yes, but my point was that your client speaks NetBeans not Java. By modifying his GUI outside NetBeans you have thrown away his NetBeans "code".
Andrew Thompson - 27 Aug 2006 16:51 GMT ...
> >I 'speak' Java, not 'NetBeans'. .. > Yes, but my point was that your client speaks NetBeans not Java. By > modifying his GUI outside NetBeans you have thrown away his NetBeans > "code". OK.. point taken. We have yet to approach the actual integration of any new code, so my ("it's Java and it works") code is more to demonstrate how simple these (much needed) changes are. I'm actually hoping the working Java code will prompt the person that originally created the form code, to update the form themselves - I have more interesting things to play with/work on!
Andrew T.
Andrew Thompson - 27 Aug 2006 16:02 GMT > >There is a project I am involved in, that was developed in > >NetBeans. ....
> I hope that Sun produce a standard for representing GUI forms and it > seems that annotations may be the way to do that. However, until that > happens we don't have Java programs. We have NetBeans programs or > JBuilder programs or JDeveloper programs and if I want something > changed in a project I would expect the maintenance programmer to > stick to the original "language". Oh,.. and if they wanted to call me a 'maintenance programmer' on this project, I would be expecting a *lot* more money, and in that event I'd be prepared to use (and learn if necessary) whatever dang IDE/GUI editor they wanted...
But for free, they get me and my Java (and my attitude). ;-)
Andrew T.
cntcltk - 27 Aug 2006 02:46 GMT The URL of the source code is: http://home.gwu.edu/~ecamposn/nscript/nscript-1.0.4.zip
It's called nscript-1.0.4 nscript is graphical user interface to create ns-2 simulation scripts, developed in Java 2. You can find more details at: http://home.gwu.edu/~ecamposn/software.html
Thanks.
> The internet is a big place, care to be more specific? > What is the URL of the source package you downloaded?
> Which brings me back to, exactly what did you download? > This can best be explained with the link to the download, > but does it contain .java files, .jar files. what? > > Andrew T. Andrew Thompson - 27 Aug 2006 10:42 GMT > The URL of the source code is: > http://home.gwu.edu/~ecamposn/nscript/nscript-1.0.4.zip Thanks for the URL - I did download the 1.4 Meg of code (+ other junk I did not bother looking at), but after having a brief look over it, I saw the posts from Thomas and David - and I think both of them are getting closer to the real answers that you need.
N.B. for anyone that is interested. The Java source is all in the 'default' package. I doubt that has any bearing on the matter, but just thought I'd mention it.
By the way - please refrain from top-posting. I find it most confusing.
Andrew T.
Alex Artemiev - 27 Aug 2006 12:18 GMT NetBeans use AbsoluteLayout that is not part of SDK. If you use it you will need add it to your program. I not sure NetBeans license allow to do it for commercial purpose. I use just text editor.
> cntc...@gmail.com wrote: >> I download ... [quoted text clipped - 20 lines] > > Andrew T. ----== Posted via Newsgroups.com - Usenet Access to over 100,000 Newsgroups ==---- Get Anonymous, Uncensored, Access to West and East Coast Server Farms at! ----== Highest Retention and Completion Rates! HTTP://WWW.NEWSGROUPS.COM ==----
David Segall - 27 Aug 2006 14:18 GMT >NetBeans use AbsoluteLayout that is not part of SDK. If you use it you will >need add it to your program. AbsoluteLayout is an additional layout manager and is roughly equivalent to no layout manager. NetBeans documentation advises against using it in production. NetBeans supports all the other layout managers including GroupLayout which is also not currently in the Java run time but will be included in the next release.
>I not sure NetBeans license allow to do it for >commercial purpose. It is, like NetBeans, open source so you can do (almost) whatever you like with it.
Thomas Kellerer - 27 Aug 2006 09:21 GMT cntcltk@gmail.com wrote on 27.08.2006 02:18:
> I download the JAVA source code of a GUI programe and import them into > the NETBEANS.I can run the code in the IDE,but I can't edit the > interface of the programe.How can I do that? > > Just like VB or Delphi:get the source code,import it into the IDE,edit > the interface,compile it and run it! If you mean with "edit" to use the visual forms builder, then this will only work if your program was created with NetBeans. NetBeans stores additional formlayout information in a separate XML file. Unless you have that file, you cannot use Matisse.
You should however be able to edit the Java code directly, just like any normal Java class. If that is not working please be more precisely whta you mean with "I can't edit"
Thomas
David Segall - 27 Aug 2006 09:52 GMT >I download the JAVA source code of a GUI programe and import them into >the NETBEANS.I can run the code in the IDE,but I can't edit the >interface of the programe.How can I do that? Unfortunately, Sun released Java as a competitor to C++ and only made a token gesture to the demand for GUI development by including a cross-platform windowing system. There is no standard way of representing a GUI so each IDE uses its own. You will have to rewrite the GUI in NetBeans but with Matisse that is probably a fairly easy task.
>Just like VB or Delphi:get the source code,import it into the IDE,edit >the interface,compile it and run it! You cannot do that with Java or C++. Both VB and Delphi are single vendor products and the IDE comes with the product. Both have additional files that represent the GUI "form". You can compare NetBeans "code", or JDeveloper code, or JBuilder code with VB or Delphi.
javajedi - 31 Aug 2006 07:20 GMT > I download the JAVA source code of a GUI programe and import them into > the NETBEANS.I can run the code in the IDE,but I can't edit the [quoted text clipped - 4 lines] > > Thx a lot! Use notepad to open the java file that you created. NetBeans wont let you to change the codes that you created with NetBeans Visual Palet.
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|