Introduction: Automatically Open Tabs in Any Browser

So your friend played a prank on you and you want to tease him back. You're scratching your head for a good idea and cannot think of one. Welcome to the world of Java. This trick that I am sharing with you, will open a specific number of tabs in your browser. As you may already know, each tab consumes a lot of memory from the RAM. The following technique may be described as a RAM overloading process, wherein the RAM gets out of memory and the entire computer crashes. This tutorial is strictly for educational purposes only and I bear no responsibilities or liabilities in case of any damage caused.

Step 1: Step 1: Get Hold of a Java IDE

IDE stands for Integrated Development Environment. It is a software where you can type in lines of programming algorithm and compile them with a click. There are lots of IDE's out there, among which popular ones are Eclipse, NetBeans, BlueJ. I use BlueJ because of it's simple and uncluttered look. You may choose any IDE you are comfortable with. Once you're done with that, create a new class. There are tutorials for every IDE how to create a new Java Class. You can easily get them by Googling them. Name the class "tab".

Step 2: Step 2: Programming Part

A machine is useless if it can't respond. Programming is vital and is like the life of a computer. Without programming it won't even respond. So you've to do the programming job nicely for the things to work out as good as you want. Once you've created a new class, type in these lines of code (I'll provide an explanation as well):

import java.awt.Robot;

import java.awt.AWTException;

import java.awt.*;

import java.awt.event.KeyEvent;

public class tab{

public static void main(String[] args)throws AWTException{

//Initial delay

Robot robot = new Robot(); robot.delay(5000);

for (int i = 1; i<=10 /* NOTE: CHANGE 10 TO ANY NUMBER OF TABS AS YOU WANT*/; i++){

robot.delay(500); // It delays by .5s to make it look like someone is opening the tabs.

robot.keyPress(KeyEvent.VK_CONTROL); // Shortcut is CTRL + T; so here we're pressing CTRL.

robot.keyPress(KeyEvent.VK_T); // Key "T" is being pressed.

robot.keyRelease(KeyEvent.VK_CONTROL); // We're releasing CTRL. We don't hold onto CTRL after everything.




After you've typed in these lines, hit Compile at the Top-left.

Step 3: Step 3: Exporting As JAR

Now after you've coded it in, you have to export it as a JAR file for it to be running on other's computers as well (without them having to compile and stuff). This is pretty easy in BlueJ. Go to Project > Export as JAR. Then choose the class name, in this case "tab". Hit OK. If you're using Eclipse IDE, you can follow this step or if you're using NetBeans, follow this.

Step 4: You're Done!

You have successfully coded and compiled the code. Send it to any of your friends. But to be fair, don't really exceed 100, it'll be really a tough time for the computer to deal with. I hope you enjoy it. You can attribute me to my work by linking back at my blog. Thanks!