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 !
We will use the .awt.*; library, since we are going to create a simple interface why not use the library for itCode:import java.awt.*; import javax.swing.*;
The base of the application !
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.Code:public class CodeCallApplet extends JApplet { public void init() {
Our functions !
There with out message and positioning it as well declaring no transparent background also what colours we will use and fontCode: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)); } }
The whole code !
However we are not done yet !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)); } }
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 !
So this code is basic html...Code:<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 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.."
![]()
Very cool! +rep
Great Tutorial Turk4n , +rep .
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"
www.amrosama.com | the unholy methods of javascriptCode:eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
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"
www.amrosama.com | the unholy methods of javascriptCode:eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
nice tutorial .. +rep![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks