Tuesday, 3 January 2017

Hi guys it has indeed been a long time since i last posted, well guys firstly i am really sorry, but you guys would have to bare with me as i have been experiencing problems with network connectivity for a while, hence, it has been a little bit of a challenge accessing the internet, but thank GOD am here, i also have an announcement, I am creating another version of this blog and using  a different CMS, basically i am migrating to wordpress, no sweat, nothing has gone wrong, i would continue posting as usual on this blog but eventually when the other site is ready i would probably shutdown this blog and of course when this blog's URL is visited the received data would be the new version. Goodbye......


become a web developer

Friday, 9 December 2016

Running a Java Program with Command Prompt

Hi guys, this post is specially for the newbie JAVA programmer, originally when i had written my first JAVA program after i had installed the JVM(Java Virtual Machine) of course, i was not using any development environments then, so i had to run the program through Command Prompt.I decided to share how i did this

  • open the directory where the file is stored, make sure to store the program as .java if you used notepad to write it.
  • when you have located the directory it is stored in you simply have to compile the .java file and to do this you simply type "javac   test.java" and this should automatically create a class file for you if there are no errors in the code.
  • Finally you run the java class file using the "java  test", make sure the name of the class is the same as the name of the file, example 
public class Test{


}

File name when saved - Test.java.

Thats everything basically.


Become a web developer

Tuesday, 6 December 2016

Combining programming and graphic design

So guys today i wish to discuss the beauty of combining two different but very compatible and complementary aspects the computer which are graphic design and programming. This two aspects are very beneficial individually to both the programmer or the designer or the buyer of the service.A combination of these two skills results in a unique blend which allows creation of practically anything, i am saying this because quite a lot of graphic designers out there have the potential to becoming very skilled programmers but haven't really been willing to invest time in the aspect of programming to complement their graphic designing skills, and are still yet to reach and harness their full potentials. I am a graphic designer and a programmer as well, i started learning graphic when i discovered how it allowed designers to create imagery easily with a computer at the time i was interested in java programming language and I was going to make sure i learnt both successfully. Today my skills in both graphic design and programming has benefited me really largely as i am currently developing a game and this would not have been possible if i was only skilled at either of the two.

some of my favorite graphic designing software applications


  1. Corel Draw
  2. Adobe Photoshop
  3. Adobe Illustrator
  4. Adobe Aftereffects
  5. Adobe fireworks
  6. Paint.Net
  7. Paint
To end  this post i still say this i am a graphic designer and a programmer currently in awka and i am currently managing a tutorial class in UNIZIK awka, and the better side is that it is only for a  meager amount of money and a lot of benefits. 

Monday, 5 December 2016

Hi guys i have to promote myself and my profession, so guys i am a graphic designer, a skilled one i basically  design posters, handbills, fliers, celebration cards; Wedding, Birthday and anything basically that entails designing, well also i am a programmer like i say all the time, as in i develop enterprise applications, utility applications, some basic desktop applications and also a Game Developer, yes i program games and i wish to share this useful information, well i am currently in Awka, Anambra state and i have decided to start a person to person tutorial this is for anyone interested in graphic design and programming, interested  persons wanting to design websites are also invited, the best part of this is i am ofering all this at very affordable rates,
if interested and in awka, Anambra, please call my no - 08160605312, or reach me through my gmail.

davidlollipop35@gmail.com.....

Introduction to web design and development

So guys lets talk about Web Design today, i am particularly a very skilled JAVA programmer and also a couple of other programming languages, i also a web designer, however, it is not really my particular interest, 
in this present day and age the skill of web designing is indeed quite useful, therefore the ability to design a dynamic website would definitely be a very useful and lucrative skill in this era. So basically websites are built with a no of programming languages but the major programming language of the web is the HTML. This is the Hypertext Markup Language, this language basically consists of tags that describe the function of every text that put in to the HTML file, examples are <b>, <h1>, <article> e.t.c., this tags are basically position at the beginning and end of every individual text sentence.
Other programming languages used to build Websites are as follows;
  1. PHP.
  2. JavaScript.
  3. CSS.
The above are the remaining programming languages used to make websites fully functional and empower websites with the capability of  performing certain functions and also endow websites with an appealing appearance.

There are a lot of Web Designers out there that are still not able to harness the full functionality of the all web designing programming languages, for instance the JavaScript is one that allows Websites to be quite dynamic and also gives websites abilities they originally wouldn't have, so if you are one person out there looking to become a Web Developer then they should be prepared and poised  to study the following programming languages fastidiously.

Personally i would recommend that anyone begins with the HTML language as this is the foundation block for communication between Web Servers and Web clients, thereafter they should proceed to CSS, this language fully means Cascading Style Sheet, this language is meant to imbue a website with an aesthetic look and give it a variety of additional advantages, so HTML, CSS  right after this two the rest of the programming languages that is PHP and JavaScript can be utilised to enhance your website with additional features. In the case of blogging , i would not discuss in detail about this but, i would list a no of domains that allow free hosting for blogs 
  1. Blogger.com is one this allows free hosting and also allows the usage of already created templates to satisfy various needs, on this note guys am done blabbering.....


 

Friday, 2 December 2016



Top five android apps for removing duplicate files on android phones

Duplicate files on any device prove to be the biggest culprit of device’s slow speed and performance. These files occupy not only the device’s storage space but it affects device’s normal functions negatively. It makes the device run slow or sometimes crawling wasting users time and efforts. These files accumulate on the device due to various reasons like file downloading, file sharing, data backup, and many other reasons. It makes complete sense to get rid of these files to improve device speed and performance. To do so you can apply manual cleaning of the device or you can use duplicate file finder and remover tools to get instant results. These tools can help you remove duplicate files instantly and accurately. Let’s discuss top 5 duplicate file finder apps here.
Duplicate Files Fixer: You can call this tool a ‘duplicate image finder’ or ‘duplicate media remover’ or ‘duplicate files finder’ as it offers extensive features as a complete package to deal with duplicate image, music, audio, video, document files. This useful app helps you find duplicate files in user specified folder, hard disk, computer or on the entire network. It uses advanced comparison algorithms to find similar files on your system. It supports all file types. You can exclude a specific file or folder from scanning process using its exclusion feature or you can also take backup of files.

It has an intuitive interface and rich documentation to support your search process. It uses powerful filters and algorithms to find similar data on your device. It supports multiple languages to help users around the world. It also supports external media devices.
Source
Search Duplicate File (Super): Duplicate files occupy a lot of storage space on your device for no good reasons. This tool helps you get rid of these files effortlessly. Using this app, you can free up a lot of storage space on your Android device instantly. It helps you clear all type of duplicate files from various folders like music, audio, video, document etc. It uses advanced technology and smart algorithms to help you find similar files instantly to free up some precious storage space.
Duplicate Manager: It helps you find, merge, move and delete duplicate files effortlessly. This tool helps you find similar files on the basis of content to provide better results. It displays original and duplicate files in results section so that you can manage your files well. Using this tool, you can also manage your contact list. It helps you find duplicate contacts on your device to make your contact list better managed. You can use this impressive tool to recover a lot of precious storage space on your device to make it run smooth and faster.
Duplicate File Finder-Remover: It helps you find and delete all kind of duplicate files like image, music, audio, video, document files easily as it supports all file types. It scans whole your device including your device’s external SD card to find and delete similar or exact looking files. It displays the visual grid for duplicate items on the result page to make it easy for you to manage files. It displays all similar files in list view in group format so that you can delete or backup files easily.
SD Maid- System Cleaning Tool: This system cleaner works as an effective duplicate files finder tool as well. It helps you detect a similar image, audio, video, document files instantly. It offers an impressive collection of tools to manage your files in a better way. It scans and finds duplicate files on the basis of file names and content. Using this app, you can browse your whole device and manipulate any file or folder through a full-fledged (root) file manager. You can run this tool on a specific time interval automatically or you can use it through widgets as well. It can help you keep your device clean and tidy.
You can use these effective tools to de-duplicate your device and to manage your files in a better way. These tools can help you declutter and organize your device data effectively. In fact, using these tools you can save a lot of your time and efforts as well. These tools are strongly recommended to get better results
Hi guys, once again another lovely post, and this time i would like to talk a little about financial literacy, i mean presently in Nigeria there are a number of networking businesses ongoing and therefore i found it mandatory to share this little info, so in the business of networking two things are key one using the internet efficiently two ensuring that the people you attempt to persuade go beyond family and friends. So i could a lot more about this in my next post and i mean in detail, i would share tips which would bring about success to any individual involved in the business of networking, anyway till the next post and i have been away for some time well it is because i am in the university and i have been really busy lately, but i assure you guys from this post forward it would be regular again, and also guys i have been thinking about including random
topics like matters concerning celebrities and breaking news, all i hope for is that it appeals to my visitors so if you guys would love to read about a variety of topics on this blog asides from programming and tech please do comment.

Well i wish to discuss briefly about networks and make my readers understand what they are basically, the internet to start is a WAN as in a Wide Area Network, the internet is basically a large number of computers connected together to share information and other resources, it mostly consists of web servers and DNS servers, DNS(Domain Name Servers), therefore anytime you open a webpage on your mobile device or computer you are actually communicating with another computer most likely a web server or DNS server and on that note i say bye, but i promise next post is going to be much more detailed.

Sunday, 27 November 2016

IP address succinct analysis

Hi guys new post, its been a couple of days i know, so i am gonna discuss with  you guys concisely what the IP addressing system is, yes Internet Protocol address.

So basically it is of two versions,

  1. IPv4.
  2. IPv6
but i will be discussing two of them in a generic manner,
so basically there are 32 bits in the address of a system using the version 4 and 128 bits for version 6.

for version 4,
the IP address is divided into two parts; the network address and the host address.
I mentioned before that the address contains 32 bits, as in 32 binary digits, base 2, 1 or 0.

So there is a term called subnet mask, it is with this term the network and host address are differentiated 
this term also contains 32 bits, therefore it either consisted of one or zero, 

example below;

IP address - 192.34.23.43 ;
above is what all IP version 4 addresses look like, i mentioned that they consisted of 32 bit, yes you would have to convert each one of the independent whole separated by the dots.

subnet mask - 255.0.255.0 ;
above is a subnet mask address i mentioned that the subnet mask consisted 32 bits, yes you would have to convert each seperated number to bits.
now if the above is converted it would be this - 11111111.00000000.11111111.00000000, 

i mentioned that you would have to convert all the separated numbers in the address to bits of bytes, by the way a byte is equal to eight bits in most cases.

if you also converted the IP addres it would be this - 11000000.00100010.00010111.00101011.

it is at this point you can now differentiate the IP address into network address and host address.

if you wish to know more about this addressing system and how it is related to websites and domains just 
comment and i would gladly share more.

so this is what is done next.

11000000.00100010.00010111.00101011 - IP address.
11111111.00000000.11111111.00000000 - sub-net mask address


for every 1 on the sub-net mask the corresponding bit on the IP address represents the network address
and for every zero the corresponding bit on the IP address represents the host address.

alrite thanks comment pls.

becom a web developer





Friday, 25 November 2016

Hi guys it is a beautiful Friday night andco well am home coding, well don worry i enjoy doing it, so i feel it's cool but i was thinking so far i have not gained much popularity but i still just enjoy doing this, i wish to inform you guys that in the weeks to come i will be uploading free applications for download really cool applications and they are all for free, but don't worry it is all completely safe for installation.

So guys wherever you are just enjoy yourself and as for my programmers and developers keep up.

Monday, 21 November 2016

Command Line Tools for Network TroubleShoooting and Source Code for JAVA Programs.

Hi guys, yes another informational post i do hope this is useful to someone out there. So well i was just thinking and it popped into my mind to share these information with my readers. So below are a compilation of some command line tools which would be useful to troubleshoot a network for administrators, and also for
regular internet users connecting to web servers over a PPP(Point to Point Protocol(as in modem or router with internet access)) connection.Don't their uses will be included....Alright......
This commands are run in the command prompt application.....to open this just search the string command prompt in Windows or whichever OS it is you use, the commands are completely platform-independent...


Net.exe The NET command is the primary command-line control for the Windows network client. You can use NET to perform many of the same networking functions that you can perform with graphical utilities, such as Windows Explorer in Windows 7 or File Explorer in Windows 8. Because NET is a command-line utility, you can include the commands in
logon scripts and batch files. For example, you can use this command to log on and off of the network, map drive letters to specific network shares, start and stop services, and locate shared resources on the network. To use the program, you execute the file from the command line with a subcommand, which may take additional parameters. These subcommands and their functions are listed in Table 26-1, with some of the key functions being examined in the following sections. The subcommands display when you type NET in the Command Prompt dialog. Windows NET  Subcommands
NET subcommands TCP/IP Utilities Transmission Control Protocol/Internet Protocol (TCP/IP) has become the most commonly used protocol suite in the networking industry, and many network administration and troubleshooting tasks involve working with various elements of these protocols. Because virtually every computing platform supports TCP/IP, a number of basic tools have been ported to many different operating systems, some of which have also been adapted to specific needs. The following sections examine some of these tools but do so more from the perspective of their basic functionality and usefulness to the network administrator than from the operational elements of specific implementations. Ping Ping is unquestionably the most common TCP/IP diagnostic tool and is included in virtually every implementation of the TCP/IP protocols. In most cases, Ping is a command-line utility, although some graphical or menu-driven versions are available that use a different interface to perform the same tasks. The basic function of Ping is to send a message to another TCP/IP system on the network to determine whether the protocol stack up to the network layer is functioning properly. Because the TCP/IP protocols function in the same way on all systems, you can use Ping to test the connection between any two computers, regardless of processor platform or operating system. Ping works by transmitting a series of Echo Request messages to a specific IP address using the Internet Control Message Protocol (ICMP). When the computer using that IP address receives the messages, it generates an Echo Reply in response to each Echo Request and transmits it back to the sender. ICMP is a TCP/IP protocol that uses several dozen message types to perform various diagnostic and error-reporting functions. ICMP messages are carried directly within IP datagrams. No transport layer protocol is involved, so a successful Ping test indicates that the protocol stack is functioning properly from the network layer down. If the sending system receives no replies to its Echo Requests, something is wrong with either the sending or receiving system or the network connection between them. When Ping is implemented as a command-line utility, you use the following syntax to perform a Ping test: PING destination where the destination variable is replaced by the name or address of another system on the
network. The destination system can be identified by its IP address or by a name, assuming that an appropriate mechanism is in place for resolving the name into an IP address. This means you can use a hostname for the destination, as long as you have a DNS server or HOSTS file to resolve the name. On Windows networks, you can also use NetBIOS names, along with any of the standard mechanisms for resolving them, such as WINS servers, broadcast transmissions, or an LMHOSTS file. The screen output produced by a ping command on a Windows system looks like Figure 26-5.
Figure 26-5 Result of using the ping command in a Windows 7 system The program displays a result line for each of the four Echo Request messages it sends by default, specifying the IP address of the recipient, the number of bytes of data transmitted in each message, the amount of time elapsed between the transmission of the request and the receipt of the reply, and the target system’s time to live (TTL). The TTL is the number of routers that a packet can pass through before it is discarded. Ping has other diagnostic uses apart from simply determining whether a system is up and running. If you can successfully ping a system using its IP address but pings sent to the system’s name fail, you know that a malfunction is occurring in the name resolution process. When you’re trying to contact an Internet site, this indicates that there is a problem with either your workstation’s DNS server configuration or the DNS server itself. If you can ping systems on the local network successfully but not systems on the Internet, you know there is a problem with either your workstation’s Default Gateway setting or the connection to the Internet.
NOTE Sending a ping command to a system’s loopback address (127.0.0.1) tests the operability of the TCP/IP protocol stack, but it is not an adequate test of the network interface because traffic sent to the loopback address travels down the protocol stack only as far as the network transport layer and is redirected back up without ever leaving the computer through the network interface.
In most Ping implementations, you can use additional command-line parameters to modify the size and number of the Echo Request messages transmitted by a single ping command, as well as other operational characteristics. In the Windows Ping.exe program, for example, the parameters are as follows: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] destination • -t Pings the specified destination until stopped by the user (with CTRL-C) • -a Resolves destination IP addresses to hostnames • -n count Specifies the number of Echo Requests to send • -l size Specifies the size of the Echo Request messages to send • -f Sets the IP Don’t Fragment flag in each Echo Request packet • -i TTL Specifies the IP TTL value for the Echo Request packets • -v TOS Specifies the IP Type of Service (TOS) value for the Echo Request packets • -r count Records the IP addresses of the routers for the specified number of hops • -s count Records the time stamp from the routers for the specified number of hops • -j host-list Specifies a partial list of routers that the packets should use • -k host-list Specifies a complete list of routers that the packets should use • -w timeout Specifies the time (in milliseconds) that the system should wait for each reply There are many different applications for these parameters that can help you manage your network and troubleshoot problems. For example, by creating larger-than-normal Echo Requests and sending large numbers of them (or sending them continuously), you can simulate user traffic on your network to test its ability to stand up under heavy use. You can also compare the performance of various routes through your network (or through the Internet) by specifying the IP addresses of the routers that the Echo Request packets must use to reach their destinations. The -j parameter provides loose source routing, in which the packets must use the routers whose IP addresses you specify but can use other routers also. The -k parameter provides strict source routing, in which you must specify the address of every router that packets will use to reach their destination. Pathping Combining the features of both Tracert and Ping, Pathping, designed for networks with more than one router between hosts, sends a series of packets to each router along the route to the host. Any packet loss at any link along the route is pinpointed by Pathping. Traceroute or Tracert Traceroute is another utility that is usually implemented as a command-line program and
included in most TCP/IP protocol stacks, although it sometimes goes by a different name. On Mac, Linux, or Unix systems, the command is called traceroute, but Windows implements the same functions in a program called Tracert.exe. The function of this tool is to display the route that IP packets are taking to reach a particular destination system. Each of the entries in a trace represents a router that processed the packets generated by the Traceroute program on the way to their destination. In each entry there are three numerical figures that specify the round-trip time to that router, in milliseconds, followed by the DNS name and IP address of the router. In a trace to an overseas destination, the round-trip times are relatively high and can provide you with information about the backbone networks your ISP uses and the geographical path that your traffic takes. For example, when you run a trace to a destination system on another continent, you can sometimes tell when the path crosses an ocean by a sudden increase in the round-trip times. On a private network, you can use Traceroute to determine the path through your routers that local traffic typically takes, enabling you to get an idea of how traffic is distributed around your network. Most Traceroute implementations work by transmitting the same type of ICMP Echo Request messages used by Ping, while others use UDP packets by default. The only difference in the messages themselves is that the Traceroute program modifies the TTL field for each sequence of three packets. The TTL field is a protective mechanism that prevents IP packets from circulating endlessly around a network. Each router that processes a packet decrements the TTL value by one. If the TTL value of a packet reaches zero, the router discards it and returns an ICMP Time to Live Exceeded in Transit error message to the system that originally transmitted it. In the first Traceroute sequence, the packets have a TTL value of 1, so that the first router receiving the packets discards them and returns error messages back to the source. By calculating the interval between a message’s transmission and the arrival of the associated error, Traceroute generates the round-trip time and then uses the source IP address in the error message to identify the router. In the second sequence of messages, the TTL value is 2, so the packets reach the second router in their journey before being discarded. The third sequence of packets has a TTL value of 3, and so on, until the messages reach the destination system. It is important to understand that although Traceroute can be a useful tool, a certain amount of imprecision is inherent in the information it provides. Just because a packet transmitted right now takes a certain path to a destination does not mean that a packet transmitted a minute from now to that same destination will take that same path. Networks (and especially those on the Internet) are mutable, and routers are designed to compensate automatically for the changes that occur. The route taken by Traceroute packets to their destination can change, even in the midst of a trace, so it is entirely possible for the sequence of routers displayed by the program to be a composite of two or more different paths to the destination because of changes that occurred in midstream. On a private network, this is less likely to be the case, but it is still possible. Route The routing table is a vital part of the networking stack on any TCP/IP system, even those
that do not function as routers. The system uses the routing table to determine where it should transmit each packet. The Route.exe program in Windows and the route command included with most other versions enable you to view the routing table and add or delete entries to it. The syntax for the Windows Route.exe program is as follows: ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]] The command variable takes one of the following four values: • PRINT Displays the contents of the routing table • ADD Creates a new entry in the routing table • DELETE Deletes an entry from the routing table • CHANGE Modifies the parameters of a routing table entry The other parameters used on the Route.exe command line are as follows: • –f Deletes all of the entries from the routing table • –p Creates a permanent entry in the routing table (called a persistent route) when used with the ADD command • destination Specifies the network or host address of the routing table entry being added, deleted, or changed • MASK netmask Specifies the subnet mask associated with the address specified by the destination variable • gateway Specifies the address of the router used to access the host or network address specified by the destination variable • METRIC metric Indicates the relative efficiency of the routing table entry • IF interface Specifies the address of the network interface adapter used to reach the router specified by the gateway variable Netstat Netstat is a command-line utility that displays network traffic statistics for the various TCP/IP protocols and, depending on the platform, may display other information as well. Nearly all operating systems support Netstat. The command-line parameters for Netstat can vary in different implementations, but one of the most basic ones is the -s parameter, which displays the statistics for each of the major TCP/IP protocols, as shown in Figure 26-6.
Figure 26-6 Netstat creates a display of IP statistics. Apart from the total number of packets transmitted and received by each protocol, Netstat provides valuable information about error conditions and other processes that can help you troubleshoot network communication problems at various layers of the OSI model. The Windows version of Netstat also can display Ethernet statistics (using the -e parameter), which can help to isolate network hardware problems. When executed with the -a parameter, Netstat displays information about the TCP
connections currently active on the computer and the UDP services that are listening for input. The State column indicates whether a connection is currently established or a program is listening on a particular port for messages from other computers, waiting to establish a new connection. Nslookup Nslookup is a utility that enables you to send queries directly to a particular DNS server in order to resolve names into IP addresses or request other information. Unlike other name resolution methods, such as using Ping, Nslookup lets you specify which server you want to receive your commands so that you can determine whether a DNS server is functioning properly and whether it is supplying the correct information. Originally designed for Unix systems, an Nslookup program is available on Mac, Linux, and Windows systems. Nslookup can run in either interactive or noninteractive mode. To transmit a single query, you can use noninteractive mode, using the following syntax from the command prompt: Nslookup hostname nameserver Replace the hostname variable with the DNS name or IP address that you want to resolve, and replace the nameserver variable with the name or address of the DNS server that you want to receive the query. If you omit the nameserver value, the program uses the system’s default DNS server. To run Nslookup in interactive mode, you execute the program from the command prompt with no parameters (to use the default DNS server) or with a hyphen in place of the hostname variable, followed by the DNS server name, as follows: Nslookup nameserver The program produces a prompt in the form of an angle bracket (>), at which you can type the names or addresses you want to resolve, as well as a large number of commands that alter the parameters that Nslookup uses to query the name server. You can display the list of commands by typing help at the prompt. To exit the program, press CTRL-C. Ipconfig The Ipconfig program is a simple utility for displaying a system’s TCP/IP configuration parameters. This is particularly useful when you are using Dynamic Host Configuration Protocol (DHCP) servers to automatically configure TCP/IP clients on your network because there is no other simple way for users to see what settings have been assigned to their workstations. Nearly all systems include the ipconfig command (derived from interface configuration).


This here is a quick summary to spare you guys all the details.

1. NET
2. IPCONFIG
3. NETSTAT
4. ROUTE
5. PING
6. TRACERT
7. PATHPING.

So instead of having to read all of the above, just type one of these commands in the app's window together with a "/" and "?". example ; PING  /? or this PING -?, it would pop up all of the usages of that command.


SECOND SECTION

So like always source code guys......this one is used too create a directory in java programming


import java.util.Formatter;

public class CreateDirectory {
public static void main(String args[]){
try{
Formatter dir = new Formatter("C:\\test\\input-file.txt");

dir.format("%s %s %s","1 ","John ","Smith \r\n");
dir.format("%s %s %s","2 ","Pablo ","Escober");
dir.close();

}
catch(Exception e){System.out.println("error");}


}


}
short and easy just include this in whichever way it would be useful to your program....


SECTION 3

This one is kind of special, source code for a simple and basic log in system in java  but also a little stylish...
and also this one is written in eclipse so the code are i suppose more legible and understandable..
as for the image file you simply would have to  create a small  icon that represents a mouse listener point for
closing the application or you might as well ignore that part...


package AppPackage;

import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.UIManager;

public class CustomLogin extends JFrame {

private JTextField password;
private JTextField name;
private JRadioButton clear;

int xMouse, yMouse, x, y;

int width = Toolkit.getDefaultToolkit().getScreenSize().width;

int height = Toolkit.getDefaultToolkit().getScreenSize().height;

String UserName = "David";
String Password = "9000";
private JLabel display;

public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
CustomLogin frame = new CustomLogin();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

public CustomLogin() {

getContentPane().addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
xMouse = e.getX();
yMouse = e.getY();
}
});


getContentPane().addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {

x = e.getXOnScreen();
y = e.getYOnScreen();
setLocation(x - xMouse, y - yMouse);

}

});

setLocation(width / 2 - 193, height / 2 - 125);
// setLocationRelativeTo(null);
setUndecorated(true);
setType(Type.UTILITY);
getContentPane().setFont(new Font("Kristen ITC", Font.PLAIN, 16));
setTitle("LOGIN");
getContentPane().setBackground(new Color(152, 251, 152));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(386, 250);
getContentPane().setLayout(null);

password = new JTextField();
password.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 14));
password.setBounds(10, 121, 281, 42);
getContentPane().add(password);
password.setColumns(10);

name = new JTextField();
name.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 14));
name.setBounds(10, 39, 281, 45);
getContentPane().add(name);
name.setColumns(10);

JButton btnNewButton = new JButton("Login");
btnNewButton.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 11));
btnNewButton.setForeground(new Color(0, 0, 128));
btnNewButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0){
if (name.getText().equals(UserName)
&& password.getText().equals(Password)){
display.setForeground(Color.BLACK);
display.setText("Successful Login");

} else {
display.setForeground(Color.RED);
display.setText("Wrong Login Details");
}
}
});
btnNewButton.setBorder(UIManager.getBorder("ToolTip.border"));
btnNewButton.setBounds(20, 174, 89, 23);
getContentPane().add(btnNewButton);

display = new JLabel("");
display.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
xMouse = e.getX();
yMouse = e.getY();
}
});
display.setBounds(30, 212, 159, 27);
getContentPane().add(display);

JLabel lblNewLabel_1 = new JLabel("NAME");
lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_1
.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 11));
lblNewLabel_1.setBounds(297, 49, 63, 26);
getContentPane().add(lblNewLabel_1);

JLabel lblNewLabel_2 = new JLabel("PASSWORD");
lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_2
.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 11));
lblNewLabel_2.setBounds(301, 128, 69, 29);
getContentPane().add(lblNewLabel_2);

JLabel lblNewLabel_3 = new JLabel("");
lblNewLabel_3.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent arg0) {
System.exit(0);
}
});
lblNewLabel_3.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_3.setIcon(new ImageIcon("C:\\Users\\DAVID\\Pictures\\cdr designs\\icons\\Tiny_button.png"));
lblNewLabel_3.setBounds(345, 11, 31, 27);
getContentPane().add(lblNewLabel_3);


clear = new JRadioButton("clear");
clear.addActionListener(new ActionListener(){

@Override
public void actionPerformed(ActionEvent e){
if(clear.isSelected()) {

name.setText(null);
password.setText(null);
display.setText(null);

clear.setSelected(false);
}
}
});
clear.setOpaque(false);
clear.setBounds(293, 171, 74, 29);
getContentPane().add(clear);
}
}