BluJay Solutions gives us a leg up over other service providers. We have visibility of our entire supply chain, which enables collaboration with everyone involved in the transportation management process. BlueJ is a free integrated development environment for Java. It's designed to help novices learn Java and object-oriented programming, although the more experienced can also use it to develop simple applications.
How to use BlueJ Writing Java Programs using BlueJSuppose you want to store your Java projects under the directoryC:CSC211.(If you are working in a DePaul computer lab, you should store somewhere on the E:drive). Create a folder/directory using Microsoft Explorer.If this directory (say C:CSC211) does not exist yet,use the Microsoft Explorer to create it.First start Explorer and go to C: (the root directory of C drive).Then under File, select New, and Folder.Change the name of the folder from 'New Folder' to 'CSC211'. Invoke BlueJ.Start BlueJ by finding and double clicking onits icon.
If you followed theinstallation directions for home, it will have an icon on the desktop.In the computer labs, select Course Applications, CSC, then BlueJ. Create a new project.In BlueJ's top menu bar, select Project andNew. To get the New Project Dialog.In Look In box, find and select the CSC211 folder that you created in Step 1.This may require you to go up/down the directory tree a few times.Enter the name of the project (say 'HelloWorld')in File name and click on Create.The Project Display Area to the middle right shouldturn white, and an icon that looks like a piece of paper should appear.
Create a new class. Click on the button New Class.to obtain the Create New Class Dialog. Enter 'HelloWorld' in the Class Name textbox,and make sure that the Class radio button is selected. Then click on the OK button.A yellow icon with the lable HelloWorld and diagonal linesshould appear. Open the editor for the class. Double click on theyellow HelloWorld icon to open the editor for that class.
Modify the code for the class. When you open theHelloWorld Class, you will see some sample code for the class, includingan instance variable x, a constructor HelloWorld, and the method namedsampleMethod. This code may be interesting the first time you see it, butit is totally worthless. Select all of the code and delete it.Then add your code. For example, the HelloWorld program would be:.
Compile the class. Click on the Compile buttonat the top of the editor. You should get the message'Class compiled - no syntax erors.'
. Run the application. Go back to the main BlueJ window. If you don'tsee it on the desktop screen, look at the bottom of the monitor screen - there are twoBlueJ windows. Then, right click onthe yellow HelloWorld icon, and select void main(args) to run the main method.You willget the Method Call Dialog.
Since you don't have any command line arguments forthis method, simply click on OK.Note: If your program (or method) takes arguments and you want to enterthem, type in values separated by commas.You will get the Terminal Window with the message 'Hello, world!' If you like to save the output to a file, select Options and Save tofile. Specify the name of the file in File name, such as'output.txt', and press Save. Get out of BlueJ. Close the Terminal Window, the Editor, and theMain BlueJ Window. The console window that opened when you invoked BlueJ shouldclose automatically.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |