Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / November 2005

Tip: Looking for answers? Try searching our database.

Help needed with BlueJ

Thread view: 
bherbst65@hotmail.com - 03 Nov 2005 06:24 GMT
Hi All,
Need help(procedures/steps) to execute
an application program using BlueJ.
I have downloaded the
BlueJTutorial.pdf, read
what is there, I can compile my program,
can make a jar,
but where is the "run" instruction
in the main menu?

Bob
JS - 03 Nov 2005 10:19 GMT
There isnt a "run" instruction as such, you have to go to File, then
"export" then save it as a jar file then open the jar file from where you
exported it to. www.bluej.org may have some help on it though. Any more
problems let me know because David Barnes and Micheal Kolling (the BlueJ
authors) are lecturers at my uni so they are bound to be able to help.
JS
> Hi All,
> Need help(procedures/steps) to execute
[quoted text clipped - 7 lines]
>
> Bob
bherbst65@hotmail.com - 03 Nov 2005 15:28 GMT
Hi JS,
Thanks for help.

I have never been comfortable with  x.jar as such because of the
near primitive means to get them to execute an application and the
complicated methods to create paths to the X.class files and image
files that accompany it. Since BlueJ has automated this .jar making
then that problem seems to be eliminated.

You might ask the authors of BlueJ how to deal with this problem:
When I work on code, I like to see if something needs an
adjustment/tweak of this or that for appearance sake and the like.
That is why I "would like to see it sooner" than before it is ready to
"hand in for final grading in a jar". Or is it a matter of constanly
modifying the version name of the program that you are writing and then
keep tossing out the older jars for the new one?

Thanks again for your help,

Bob
Andrew Thompson - 03 Nov 2005 16:08 GMT
> I have never been comfortable with  x.jar as such because of the
> near primitive means to get them to execute an application and the
[quoted text clipped - 9 lines]
> modifying the version name of the program that you are writing and then
> keep tossing out the older jars for the new one?

I have read that several times but still do not
quite understand what you are saying.

OTOH, I will make this point.

Whether deploying as a Jar or (much less often) a series of class
files, developers almost always have easy access to throwing a
'work in progress' onto the screen to check the current changes.
They would have a hard time developing without that easy ability.

Either it should be very easy to create an launch a Jar from
the IDE, or alternately launch the application using the
unjarred class files.

Is 'Seeing the application on-screen after changes' the
basic nature of the problem?
Redbeard - 03 Nov 2005 17:47 GMT
BlueJ is not a normal IDE.  It is specifically designed as a teaching
tool, not a production tool.  It focuses on visual representations of
objects to better help the student understand OOP concepts.    In
BlueJ, for example, you can instantiate an object, call its methods,
and see the changes in its instance variables visually WITHOUT the need
to write a main method.

However, some things that are simple in a traditional IDE (or even from
the command line) are not that simple in BlueJ.  For example, in most
IDE's, there is a button that will execute an application, but not in
BlueJ.

It is a popular teaching tool worldwide, but it is NOT something that
an actual developer would use.
bherbst65@hotmail.com - 03 Nov 2005 18:59 GMT
Thanks Andrew and Redbeard,

Maybe for the same reasons that I tossed BlueJ before: "jar it to see
it run" doesn't make sense to me.

These other lightwieghts have flaws too:
DrJava doesn't jar anything by itself.
GEL gets mixed up in its delivery and storage.

And  JBuilder2005 overstuffs my computer.

At this point, as I have jdk1.5.0_05, any recommendations from either
of you  for all around lightwieght IDE?

Bob
JS - 03 Nov 2005 19:25 GMT
You can run classes and things without making them into a jar because all
you need to do is compile them then right click on the class you want to use
and selecting the "constructor (s)" shown. you can create as many classes as
you want that way. Also be careful creating jars with images. The version we
had, and I'm not sure if this has changed, only allowed us to include images
OR include a main method which made it runnable. we all found that out when
we had an assignment due and he neglected to tell us that so we were all
panicking about the file. It does have a very useful debugger and step
through tool which no other Java IDE I have seen does have. I was tempted to
write my own but I'm not sure how as yet and also havent really got time on
my side what with other projects that have more deadlines. Any ideas from
anyone or if anyone wants to work on one with me feel free to contact me.
I now use JCreator which I found to be pretty good. I'm not sure how it
works when it comes to jar files or javadocs yet because we mainly have to
submit .java and .class files for uni work but there must be a way. Netbeans
and Eclipse are also pretty good so I've heard but I havent really looked at
them and they are quite memory intensive on some machines.
Hope that helps and if anyone has any ideas then feel free to get in touch
JS
> Thanks Andrew and Redbeard,
>
[quoted text clipped - 11 lines]
>
> Bob
bherbst65@hotmail.com - 04 Nov 2005 14:51 GMT
JS,
Your clues: after compiling (above).....
Are  you thinking that there is something that I can right click on the
BlueJ panel or is this some place else. Frankly, I don't see except in
the outermost frame of BlueJ: a white empty frame and the yellow-orange
shaded frame of the .java named program that are loaded . And after
compiling the right  click on the yellow-orange shaded frame sets a red
box in  the lower left and right clicking on it does nothing.
I have version 2.05 of BlueJ.
Michael Kölling - 06 Nov 2005 00:29 GMT
Bob,

There is no need to create a jar file to execute something in BlueJ.
You can execute any program directly from within BlueJ.

In fact, you can execute more than in other IDEs: you can execute the
main method (as in other environments) or any other public method.

To execute the main method (if you have one), right-click the class in
the diagram (the "yellow-orange thingy") and select the main method
from the popup menu.

To execute other (non-static) methods, right-click the class, select a
constructor, and then right-click the created object (the "red box")
and select your methods.

This is described in much more detail in the tutorial. I suggest that
you read it again and work through it. Especially section 3.4
("Execution") and section 10.3 ("Calling main and other static
methods").

Regards,

Michael
Steve Horsley - 06 Nov 2005 18:03 GMT
> Hi JS,
> Thanks for help.
[quoted text clipped - 16 lines]
>
> Bob

To run it as an application, you need a "main class" with a method:
    public static voin main(String[] args) {

Once you have written this method, you can start the application
from within BlueJ by right-clicking the class icon that contains
this method, and choosing that method from the pop-up list. You
will be prompted to supply the String[] argument.

Steve
bherbst65@hotmail.com - 07 Nov 2005 13:11 GMT
Michael, Steve, and All,

Thanks for the help, I appreciate it.

While reading the BlueJ Tutorial, my mind was focused on the idea that
this was  "prescriptive" with assurances this is  the way it was to
look. I failed to read: "you should see something similar to the window
shown in Figure 1 except on your machine ... the differences should be
minor.

For the record here:  Using a sample java application program of mine,
titled "lab1", and after compilation,  right clicking the title bar of
the application on the main page  that has the diagram (the
"yellow-orange thingy")  brings a pop up with many choices. Selecting
from the list of choices with a left or right click:
"void main(Strings[] args) " and from the next popup window which
appears as:

BlueJ: Method Call
void main(Strings[] args)
lab1.main({ })

Note: I made  no changes in the entry of the  "{ }".

Clicking OK  does a  "execute" or a "run"  of the java program.

Thanks again to all for responding.

Bob


Free Magazines

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

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.