Monday, 23 July 2018

Add States in Dropdown When Nation Is Selected | Add Values In Dropdown box Using Javascript | HTML tutorial

Code :-
<html>
    <head>
        <script>
            function random_function()
            {
                var a=document.getElementById("input").value;
                if(a==="INDIA")
                {
                    var arr=["Maharashtra","Delhi"];
                }
                else if(a==="USA")
                {
                    var arr=["Washington","Texas","New York"];
                }
             
                var string="";
             
                for(i=0;i<arr.length;i++)
                {
                    string=string+"<option value="+arr[i]+">"+arr[i]+"</option>";
                }
                document.getElementById("output").innerHTML=string;
            }
        </script>
    </head>
    <body>
        <select id="input" onchange="random_function()">
            <option>select option</option>
            <option>INDIA</option>
            <option>USA</option>
        </select>
        <div>
           <select id="output" onchange="random_function1()">
        </div>
    </body>
</html>
Dialogs :-

Hey guys, this is unpossible pog.
Today’s tutorial will be how to add values in dropdown when we select other dropdown.in this case we are adding states or cities in dropdown when you select contries.
First create a normal dorpdown, give it an ID as “input”.
I shall add nations in it.
Let’s check it.
Now add script tag, and create a function with any random name.
In select tag, onchange event, call the function name.
Now, the function is called correctly.
But we don’t need alert, so I shall remove it.
Lets create a variable “a” to get nation name from dropdown.
Then create division and give it an ID as “output”.
Lets print the nation’s name.
So far so good.
Now we need if else statements.
Give equals to symbol “three times”.
Add states in array.
We need a string and for loop.
We are appending the string.
Change “a” to “string”.
Let’s check if all states are coming or not.
Before and after array, add option tag in double quote.
Add name if you want to send it through form.
Add select tag inside div just to make an illusion.
So thats it guys, if you want code, then the link is in the description.
don’t forget to Like,share and subscribe. Thank you for watching, bye.





Friday, 15 June 2018

Java Tutorial : Auto Completing JTextField | Auto Suggesting Textbox | Java Swing

Java Tutorial : Auto Completing JTextField | Auto Suggesting Textbox | Java Swing
Code :-
Watch the video above to understand how to autocomplete jtextfield
Code of set 
Set<String> s=new TreeSet<String>();
        s.add("unpossible");
        s.add("pog");
         s.add("steve rogers");

Copy below code in key_released event of jtextfield.

if(evt.getKeyCode()==KeyEvent.VK_BACK_SPACE||evt.getKeyCode()==KeyEvent.VK_DELETE)
        {
           
        }
        else
        {   
            String to_check=jTextField1.getText();
            int to_check_len=to_check.length();
            for(String data:s)
            {
                String check_from_data="";
                for(int i=0;i<to_check_len;i++)
                {
                    if(to_check_len<=data.length())
                    {
                        check_from_data = check_from_data+data.charAt(i);
                    }
                }
                //System.out.print(check_from_data);
                if(check_from_data.equals(to_check))
                {
                    //System.out.print("Found");
                    jTextField1.setText(data);
                    jTextField1.setSelectionStart(to_check_len);
                    jTextField1.setSelectionEnd(data.length());
                    break;
                }
            }
        }

Monday, 11 June 2018

Linux Remote Desktop Connection In Home LAN | Ubuntu And Linux Mint | Re...














Hey
guys, this is unpossible pog, today I shall show you how to configure
remote desktop connection using two linux operating systems on home
LAN.
In
this examples, I shall be using ubuntu and linux mint. Both are
connected to same router. Ubuntu is connected by LAN wire and mint
is connected by wifi.
First
you need to install remmina remote desktop client software.
So
open the terminal and type this command "sudo apt-get install remmina" on both ubuntu and linux
mint.
As
you can see, I already installed this.
Now
I am using ubuntu as srever and linux mint as client.
So
first go to client that is linux mint and search for desktop sharing.
Now
check allow other user to view your desktop.
Now
open remmina software on both computers.
Now
go to mint and open terminal, and type command ip addr show.
Now
the inet is ur ip address.
Type
that ip address there and select VNC. And click on connect.
Allow
it from linux mint.
And
now linux mint is connected to ubuntu.
Whatever
changes I am doing, they are occurring on both desktop.
So
thats is guys.
don’t
forget to Like,share and subscribe. Thank you for watching, bye.















JAVA Swing Auto-Suggesting Textfield Tutorial COMING SOON!