How to edit the GUI source code?

C

cntcltk

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!
 
A

Andrew Thompson

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.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Andrew said:
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?

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
 
H

hiwa

Arne Vajhøj ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸:
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
That's right. Netbeans can't handle generically written Java source
code.
Beginner never should use IDE, I firmly believe.
 
A

Andrew Thompson

hiwa said:
Arne Vajhøj ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸:

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.
 
T

Thomas Kellerer

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
 
D

David Segall

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.
 
A

Andrew Thompson

cntcltk said:

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.
 
A

Alex Artemiev

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.

Andrew Thompson said:
The internet is a big place, care to be more specific?
What is the URL of the source package you downloaded?


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.




----== 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 ==----
 
D

David Segall

Alex Artemiev said:
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.
 
D

David Segall

Andrew Thompson said:
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'.
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".
 
A

Andrew Thompson

David said:
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.
 
A

Andrew Thompson

David said:
.....
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.
 
D

David Segall

Andrew Thompson said:
??? 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.
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.
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".
 
A

Andrew Thompson

David Segall wrote:
....
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.
 
J

javajedi

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!

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top