Tuesday, 18 March 2014

Java Applet

Applet provides more compatibility with Graphical User Interface. You can Add-on more features such as buttons,menu-bars,frames, can be useful to develop different application like games, any software etc.

There are two types of applet in java:
1.Simple applet based on Applet Class ,use the abstract window toolkit(AWT) to provide the graphical user interface.

2. Swing Class Applet "JApplet". It provides the same features as we used in AWT along with some richer function and additional functionality to the AWT function and more compatible with graphics functions.
JApplet inherits Applet .


HTML APPLET Tag

Applet can run on the browser window through <applet> tag and you can get the output as you get in your appletviewer.
The one restriction with appletviewer is it executes only one java program at one time,In Contrast, browser can consists of more than one applet Contains.Let's have a look at how to enroll the applet tag in browser window.
Applet tag with their some alternatives:
<applet
code="name_of_java_class_name"
width=pixels
height=pixels
align=alignment
vspace=vertical_space_pixels
hspace=horizontal_space_pixels

</applet>

To get details about the attributes of applet tag : click on Java Label.


Tuesday, 11 March 2014

HTML and JavaScript

HTML and JavaScript works together.JavaScript is a Scripting language. That is, the code is not
compiled but instead it appears as ASCII text in an HTMLfile.

JavaScript is used,when you have Scenario such as you have created a website in which you want to give many options to the users and if user chose any option out of them then what action to be performed at that instant, That's where JavaScript matters.

For integrating it into the HTML code, you have three possibilities:

1. Inclusion in header part:

    ==> Incapacitate into header part:   


<html>

<head>

<title>

My Page

</title>

<script language="javascript">

/*

write your code here

functions and methods

*/

</script>

The Tag <script language="JavaScript"> introduces the JavaScript source code, the tag
</script> ends it.

For Second incorporation of JavaScript into html code ,Click Here 

For Further details about JavaScript go to "JavaScript" Label.


First Java Script Program

This is first JavaScript program."alert( )" function used to pop-up the some message.It will display the content written before the script programming than the script will be available with pop-up box.

Program:


<html>
<head>
<title> MY first Javascript Page </title>
</head>
<body>
<h3>
My first javaScript Page
</h3>
<script>
alert("Hello My Page");
</script>
My Second-Half of JavaScript Page
<script>
alert("Hello my Second Half");
</script>
</body>
</html>

Output will Display Like this on Your Browser:




 










Look At the other Programs in JavaScript Label. 

HTML and JavaScript Incorporation

In First Incorporation we have how to include JavaScript in HTML header part.

For Second Possibilities of inclusion of JavaScript in Html Code is you code part.It's just depend on your code to carry out any functionality or any reaction,change in something like to over the mouse of any particular thing then what action has been specified.

In this,When the Web Page loads there is a pop-up alert open and give some reaction tell us something through display message.

<body onload="hello()">
Hello function is to be performed whenever page loads.


For Complete program refer this Link:  Incorporation Program

Third Incorporation of HTML and Java.

Further Fuctionality and programs of JavaScript and HTML refer Divisions.

Tuesday, 4 February 2014

Lex Analyzer for Windows

Lex Analyzer for Windows:


 It's very complex to run operating system environment into one system and no one wants to use of Linux for ever for the Lex Analyzer.so Here is a tool Which will work same as Lex Analyzer.
Download this from Link Below:

   1.Flex
    2.Bason




How To Compile the Lex Programs

1. Firstly, make the lex file according to the given format and then save the file with extension ".l" such as: "file_name.l".
2. Lex files can be compiled using any Lex Analyzers like 'flex' Analyzer for Windows.
3.Use the lex program to turn into a C language program. The resulting program is in the lex.yy.c file.
4. Use the C compiler with the -ll flag to compile and link the program with a library of lex subroutines. The resulting executable program is in the a.out file.

For Example,

$$ lex file_name.l
$$ gcc lex.yy.c -ll
$$ ./a.out 

                                       OR
  
$$ lex -t file_name.l > file_name.c 
$$ cc -o file_name file_name.c -ll