HTML DOM Input FileUpload autofocus Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

49 Views

The HTML DOM Input FileUpload autofocus property sets/returns whether Input FileUpload is focused upon initial page load.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputFileUploadObject.autofocusSetting autofocus to booleanValueinputFileUploadObject.autofocus = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that input will be autofocused on page load.falseIt is the default value and input is not autofocused.ExampleLet us see an example of Input FileUpload autofocus property − Live Demo Input FileUpload autofocus    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px; ... Read More

Java Program to sort Integer list in reversed order

Krantik Chavan
Updated on 30-Jul-2019 22:30:26

131 Views

Following is our integer array:Integer[] arr = {20, 50, 100, 150, 200, 250, 300, 350, 400, 500};Now convert the above Integer array to List:List list = new ArrayList(Arrays.asList(arr));Now, to sort the above Integer list in reversed order:Comparator initialComp = Integer::compare; Comparator revComp = initialComp.reversed(); Collections.sort(list, revComp);The following is an example to sort Integer list in reversed order:Exampleimport java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; public class Demo {    public static void main(String[] args) {       Integer[] arr = {20, 50, 100, 150, 200, 250, 300, 350, 400, 500};       List list = new ... Read More

How to determine whether C++ code has been compiled in 32 or 64 bit?

Smita Kapse
Updated on 30-Jul-2019 22:30:26

702 Views

In C++, there is no direct way to check the environment architecture. There are two Macros for Windows systems, that can be used to check the architecture. These macros are _WIN64, and _WIN32. When the system is 64-bit, then the _WIN64 will be 1, otherwise the _WIN32 will be 1. So using macro checking, we can identify the architectureExample#include using namespace std; int main() {    #ifdef _WIN64       cout

How to get notified when a notification is notified?\

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

38 Views

This example demonstrate about How to get notified when a notification is notifiedStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID = "10001" ;    private final static String default_notification_channel_id = ... Read More

Find the MongoDB document from sub array?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

343 Views

You can use dot(.) notation to find the document from sub array. Let us first create a collection with documents −> db.findDocumentDemo.insertOne( ...    { ...       "EmployeeDetails" : ...       { ...          "EmployeeAppraisalTime": ... ...          [ ... ...             {"EmployeeDesignation": "Developer", "Salary": 45000}, ...             {"EmployeeDesignation": "Tester", "Salary": 30000}, ...             {"EmployeeDesignation": "HR", "Salary": 22000}, ...             {"EmployeeDesignation": "Accountant", "Salary": 18000} ...          ] ... Read More

How to add a title to JTable in Java Swing?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

1K+ Views

To display a title to the JTable, you can set a title for the JPanel, which already consists of a JTable.Here, we are using createTitledBorder() for the JPanel to set the title for the panel border that would eventually work for table title.Let’s say the following is the JPanel −JPanel panel = new JPanel();Now, use setBorder() and the BorderFactory class to set a title border for the panel that would be our table title as well −panel.setBorder(BorderFactory.createTitledBorder(    BorderFactory.createEtchedBorder(), "My Demo Table", TitledBorder.LEFT, TitledBorder.TOP));The following is an example to add a title to a JTable −Examplepackage my; import javax.swing.BorderFactory; import ... Read More

Java Program to set major tick marks in a JSlider every 25 units

Anvi Jain
Updated on 30-Jul-2019 22:30:26

236 Views

Major Tick marks is the number passed in representing the distance between each major tick mark. For example, a slider with range from 0 to 75 and major tick spacing 25, would give major ticks next to the following values: 0, 25, 50, 75.To set major tick marks, use the setMajorTickSpacing() method −JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 55); slider.setMajorTickSpacing(25);Note − For major ticks to be painted, you need to set setPaintTicks to true.The following is an example to set major tick marks in a slider every 25 units −Examplepackage my; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.WindowConstants; public ... Read More

How to select a row where one of several columns equals a certain value in MySQL?

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

305 Views

For this, you can use multiple OR. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    FirstName varchar(10),    LastName varchar(10),    Age int,    CountryName varchar(10)    ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(FirstName, LastName, Age, CountryName) values('John', 'Smith', 21, 'US'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable(FirstName, LastName, Age, CountryName) values('Carol', 'Taylor', 22, 'AUS'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable(FirstName, LastName, Age, CountryName) values('David', ... Read More

Print prime numbers in a given range using C++ STL

Smita Kapse
Updated on 30-Jul-2019 22:30:26

435 Views

It is the program to print prime numbers in a given range.AlgorithmsBegin    Declare a user define datatype stl.    Declare a vector number to the stl datatype.    Declare variable a to the stl datatype.    Declare vector Prime_Number to the Boolean datatype.       Prime_Number[0] = false.       Prime_Number[1] = false.    Declare b to the integer datatype.       Initialize b = sqrt(a).    for (stl pr=2; pr

What are the default array values in Java?

Venkata Sai
Updated on 30-Jul-2019 22:30:26

2K+ Views

In Java arrays are the reference types which stores multiple elements of the same datatype. You can create an array just like an object using the new keyword −type[] reference = new type[10];or, directly using the flower brackets ({}).int [] myArray = {10, 20, 30, 40, 50}When you create instance variables in Java you need to initialize them, else the compiler will initialize on your behalf with default values.Similarly, if you create an array as instance variable, you need to initialize it else the compiler initializes with default values which are −Integer − 0Byte − 0Float − 0.0Boolean − falseString/Object ... Read More

Advertisements