Create JTable from Two Dimensional Array in Java

Chandu yadav
Updated on 30-Jul-2019 22:30:26

816 Views

With two dimensional array, set the columns of a table. Additionally, we have set the rows using a one-dimensional array as shown below −DefaultTableModel tableModel = new DefaultTableModel(new Object[][] {    { "Mobile Phones", "100" }, { "RAM", "200" }, { "Caps", "50" },    { "Tablet", "80" }, { "LED", "400" }, { "Trousers", "350" },    { "T-Shirt", "500" }, { "Hoodie", "650" }, { "Jeans", "900" } },    new Object[] { "Items", "Quantity" } );Now set the table model to the table −JTable table = new JTable(tableModel);The following is an example to create a table from ... Read More

Generate AP Series of N Numbers in 8086

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

766 Views

In this program we will see how to find AP series using 8086.Problem StatementWrite 8086 Assembly language program to find AP series. The limit of the series is stored at 500, First term is stored at 501, and the common difference is stored at 502.DiscussionAP generation is simple task. We are taking the limit as counter value, the first term is loaded into AL first, then the BL is holding the common difference d. Now the result is storing memory offset 600 onwards. The AL is placing as it is, then repeatedly add BL with AL and store it into ... Read More

Check If a Key Exists in JavaScript Object

vineeth.mariserla
Updated on 30-Jul-2019 22:30:26

354 Views

There are a couple of ways to find whether a key exist in javascript object or not.Let's say we have an 'employee' object as shown below.   var employee = {       name: "Ranjan",       age: 25    }Now we need to check whether 'name' property exist in employee object or not.1) 'In' operatorWe can use 'in' operator on object to check its properties. The 'in' operator also looks about inherited property if it does not find any actual properties of the object.In the following example when 'toString' is checked whether present or not, the 'in' operator ... Read More

HTML DOM Anchor Hash Property

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

213 Views

The HTML DOM Anchor hash property is used to set or return the anchor part of the href attribute value. The part of the URL after the # is what we call the anchor part of a link.Following is the syntax to set the hash property −anchorObject.hash = anchor_partAbove, anchor_part is the anchor part of the URL.Following is the syntax to return the hash property −anchorObject.hashLet us now see an example to implement the DOM Anchor hash property −Example Live Demo Company Our Team Get the anchor part... Display Anchor Part    function display() {     ... Read More

Add Days to STR_TO_DATE MySQL Function

Kumar Varma
Updated on 30-Jul-2019 22:30:26

174 Views

You can use DATE_ADD() function from MySQL. Let us first create a table −mysql> create table DemoTable    -> (    -> ShippingDate varchar(100)    -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('06-01-2019'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('01-04-2017'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('29-06-2019'); Query OK, 1 row affected (0.47 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+--------------+ | ShippingDate | +--------------+ | 06-01-2019   | ... Read More

HTML DOM Input Date StepUp Method

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

103 Views

The HTML DOM Input Date stepUp() method defines the amount of days the date field should increase.SyntaxFollowing is the syntax −Calling stepUp method with a number, which by default is equal to 1inputDateObject.stepUp(number)ExampleLet us see an example of Input Date stepUp method − Live Demo Input Date stepUp() Calendar: Increase by 2 Increase by 3    var divDisplay = document.getElementById("divDisplay");    var inputDate = document.getElementById("dateSelect");    function changeStep(num){       if(num===2)          inputDate.stepUp(2);       else          inputDate.stepUp(3);       divDisplay.textContent = 'Current date increased by: '+num;    } OutputThis will produce the following output −Clicking ‘Increase by 2’ button −Clicking ‘Increase by 3’ button −

HTML DOM ins datetime Property

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

117 Views

The HTML DOM ins dateTime property returns the date and time for when the text was inserted.SyntaxFollowing is the syntax −Returning string valueinsObject.dateTimeExampleLet us see an example for ins dateTime property − Live Demo ins dateTime    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } ins-dateTime Fact: Water cannot persist on moon's surface. Water ice found on ... Read More

MySQL Query to Get a Field Value That Does Not Contain Empty Spaces

Chandu yadav
Updated on 30-Jul-2019 22:30:26

516 Views

Use NOT LIKE for this. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentFullName varchar(40)    ); Query OK, 0 rows affected (0.66 sec)Insert records in the table using insert command −mysql> insert into DemoTable(StudentFullName) values('JohnSmith'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable(StudentFullName) values('John Doe'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(StudentFullName) values('Adam Smith'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable(StudentFullName) values('CarolTaylor'); Query OK, 1 row affected (0.19 sec)Display all records from the table using ... Read More

Counting Common Elements in MySQL

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

464 Views

To count common elements, use COUNT() and GROUP BY. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Number int    ); Query OK, 0 rows affected (0.20 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Number) values(10); Query OK, 1 row affected (0.06 sec) mysql> insert into DemoTable(Number) values(20); Query OK, 1 row affected (0.04 sec) mysql> insert into DemoTable(Number) values(20); Query OK, 1 row affected (0.04 sec) mysql> insert into DemoTable(Number) values(30); Query OK, 1 row affected (0.04 sec) ... Read More

Is Bitcoin Legal in India?

Prasanna Kotamraju
Updated on 30-Jul-2019 22:30:26

219 Views

Cryptocurrency is not a traditional currency as well as you cannot even get it through a traditional method; this makes it a completely different asset than the rest. Thus, its legality puts it under the dark clouds of doubt. Thus, the question leaves a number of investors and other crypto lovers into a riddle because bitcoin carries an immense gloomy phenomenon along with it.The status of bitcoin (and related crypto instruments) varies substantially from country to country and yet remains undefined. Moreover, it is changing in many countries. Most countries do not tag the usage of bitcoin as illegal. They ... Read More

Advertisements