Thursday, September 24, 2009

Discussions bout the Previous Post

text source code
*System.out.println -
tells the program to output or print a text in a new line
dialog box code
instructs the computer to perform an action, namely to print the string of characters contained between the double quotation marks (according to our teacher)

*import javax.JOptionPane -
calls the class
is an import statement.

--------------
the output of my program coming sooon!!!!

Chapter 1 cont. "JAVA"






TOPIC: JAVA
Java Program that will view a text, dialog box and an applet.
The Problem: Print Out your info's about our blog in three lines
First: Making a Flow Chart or Pseudo code =)
Then were gonna start with the source code of TEXT
// Blog.java
// Prints all about my blog in three separated lines
public class Blog
{ //start of the main method
public static void main (string args [] )
{
System.out.println ("debugmylife.blogspot.com");
System.out.println ("blog about what i have learned in school");
System.out.println ("visit my site!!");
} //end method main
} //end class

then save with the name of the class .java ex Blog.java
now let's go to DIALOG BOX
// BlogDialogbox.java
// Display a Dialog Box
import javax.swing.JOptionPane; //import class
public class BlogDialogBox
{ // main method starts
public static void main (string args [] )
{
JOptionPane.showMessageDialog (null, "debugmylife.blogspot.com \n
blog about technology \n visit my site!!");
System.exit(0); //terminate the app
}
}
done with the dialog box, let's now proceed to APPLET

// BlogApplet.java
//Just like the other first 2
import java.awt.*;
import java.applet.*;
public class BlogApplet.java
{
public void paint ( Graphics g )
{
g.drawString (" debugmylife.blogspot.com ", 15, 20);
g.drawString (" blog about technology ", 15, 30);
g.drawString (" visit my site!! ", 15, 40);
}
}
then convert to html the BlogApplet.java

its all done! and now the explanations and discussions
i think let's go on the next post--->