Jump to content

CodeCall's First Applet - Simple Version !

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
13 replies to this topic

#1
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts
Hey CodeCall, while reading C++ things I thought I have forgotten to show you guys about applets :)

So today I present you simple tutorial about how to create an applet(Java)!

So lets move on !

The library we will use for the applet !

import java.awt.*;

import javax.swing.*;

We will use the .awt.*; library, since we are going to create a simple interface why not use the library for it ;)

The base of the application !

public class CodeCallApplet extends JApplet {

public void init() {

Here are we making it clear for the application that we are gonna use the JApplets functions, i.o.w; we are going to inheritance its functions.

Our functions !

JLabel L = new JLabel("Welcome to CodeCall Applet !,JLabel.CENTER);

add(L);

L.setOpaque(true);

L.setBackground(Color.gray);

L.setForeground(Color.black);

L.setFont(new Font("SansSerif", Font.BOLD, 24));

}

}

There with out message and positioning it as well declaring no transparent background also what colours we will use and font :)

The whole code !
import java.awt.*;

import javax.swing.*;

public class CodeCallApplet extends JApplet {

public void init() {

JLabel L = new JLabel("Welcome to CodeCall Applet !,JLabel.CENTER);

add(L);

L.setOpaque(true);

L.setBackground(Color.white);

L.setForeground(Color.black);

L.setFont(new Font("Arial", Font.BOLD, 24));

}

}

However we are not done yet !
We didn't have main, oh noes, well we will let the browser do the job ;)

So let's create a html file to try out our applet !

The html file !
<html>

<head>

<title>CodeCall's first applet</title>

</head>

<body>

CodeCall Applet !

<br>

<applet code="TestApplet.class"

width="400"

height="150">

</applet>

<br>

</body>

</html>
So this code is basic html...

So I hope you guys enjoy this and will have some cool usage of it sometime in life :)

Cheers !

P.S - Have a screenshot, also pardon the black;"private things there nowdays.." :P
[ATTACH]1258[/ATTACH]

Attached Files


Posted Image

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Very cool! +rep

#3
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts

Jordan said:

Very cool! +rep

Thanks :D
Posted Image

#4
mendim.

mendim.

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,393 posts
Great Tutorial Turk4n , +rep .

#5
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts

mendim. said:

Great Tutorial Turk4n , +rep .

Thank you :D
Posted Image

#6
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
very nice, i have exam in java on saterday
this must come in handy
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#7
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts

amrosama said:

very nice, i have exam in java on saterday
this must come in handy

Cool :D
Posted Image

#8
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
if u wanna ean extra rep
write a simple tutorial on how to get data from a server and dislay it in a page
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#9
Egz0N

Egz0N

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 4,034 posts
nice tutorial .. +rep :)

#10
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts

Egz0N said:

nice tutorial .. +rep :)

Thanks :D
Posted Image

#11
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Very nice.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#12
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts
Thank you everyone !
Posted Image