To select all cells in a table in Java Swing, you need to use the selectAll() method. Let’s say the following are our table rows and columns −String[][] rec = { { "001", "Shirts", "40" }, { "002", "Trousers", "250" }, { "003", "Jeans", "25" }, { "004", "Applicances", "90" }, { "005", "Mobile Phones", "200" }, { "006", "Hard Disk", "150" }, }; String[] header = { "ID", "Product", "Quantity" };Set it for a table −JTable table = new JTable(rec, header);Now select all the rows and columns −table.selectAll();The following is an example to ... Read More
Here we will see how to find sum of two array elements and store result into memory.Problem StatementWrite 8086 Assembly language program to find summation of two arrays stored at 501 onwards and 601 onwards. The size of array is stored at location 500. After calculating the sum results are store result at 501 onwards.DiscussionTo solve this problem, we are taking elements from first array using source register SI, and second array using destination register DI. Repeatedly take elements from SI to AL, then add with the content of DI, and store again into SI address. Thus it is solved.InputAddressData……500055012C5020B5037D5042550521……601BA6024560369604CA60595…… Flow ... Read More
Here we will see how to split two nibbles of an 8-bit number.Problem StatementWrite 8085 Assembly language program to split two nibbles of an 8-bit number. Number is stored at F050, we will store result at F051 and F052.DiscussionTo get the nibbles separately, at first we are taking number into B register as a copy. Now mask upper nibble to get lower nibble and store it, then take the number from B again, mask lower nibble to get upper nibble, then rotate it four times to make it lower order nibble, after that store it to another location.InputAddressDataF05035 AddressDataF050BE Flow Diagram ProgramAddressHEX CodesLabelsMnemonicsCommentsF0003A, ... Read More
The colspan attribute of the element is used to set the number of columns a header cell should span.Following is the syntax −Above, num is the count of columns a header cell should span.Let us now see an example to implement the colspan attribute of the element −Example Live Demo table, th, td { border: 2px solid green; } Product Expenses Expenses Product Development 500000 Marketing 500000 Services 100000 Support 100000 Maintenance 100000 Total Budget = INR 1300000 OutputIn the above example, we have set the column count to span the header cell −ExpensesThe count is 2, therefore two columns will span the header cell.
Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(100), -> Age int -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Name, Age) values('Robert', 24); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(Name, Age) values('Chris', 22); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+----+--------+------+ | Id | Name | Age | +----+--------+------+ ... Read More
The InputEvent Object represents all the events that correspond to content change of a form element.PropertiesHere, “InputEvent” can have the following properties/methods −Property/MethodDescriptiondataIt returns the string corresponding to inserted characterdataTransferIt returns an object containing information about the interested/deleted datagetTargetRanges()Returns an array containing target ranges that will be affected by the insertion/deletion.inputTypeIt returns the type of inputisComposingIt returns the state of the eventExampleLet us see an example for InputEvent data property − Live Demo InputEvent Data form { width:70%; margin: 0 auto; text-align: center; } * { ... Read More
If you do not specify unsigned, then bigint will be signed. If you specify an unsigned, then bigint will be unsigned.Let us first create a table −mysql> create table DemoTable ( Number bigint, // signed Number2 bigint unsigned // unsigned ); Query OK, 0 rows affected (1.08 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(18446744073709551615, 18446744073709551615); ERROR 1264 (22003): Out of range value for column 'Number' at row 1 mysql> insert into DemoTable values(9223372036854775807, 18446744073709551615); Query OK, 1 row affected (0.28 sec)Display all records from the table using select statement −mysql> ... Read More
For this, use subquery along with HAVING clause. Let us first create a table −mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentFirstName varchar(20), StudentLastName varchar(20) ); Query OK, 0 rows affected (0.27 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(StudentFirstName, StudentLastName) values('John', 'Smith'); Query OK, 1 row affected (0.04 sec) mysql> insert into DemoTable(StudentFirstName, StudentLastName) values('Carol', 'Taylor'); Query OK, 1 row affected (0.04 sec) mysql> insert into DemoTable(StudentFirstName, StudentLastName) values('John', 'Doe'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable(StudentFirstName, ... Read More
In this program we will see how to add the digits of an 8-bit number.Problem StatementWrite 8086 Assembly language program to add the digits of an 8-bit number stored in memory address 2000H.DiscussionTo get the digits of an 8-bit number, we can use the masking operation. At first we will mask the upper nibble, and then the lower nibble. After masking the upper nibble, we have to rotate it to the right to make it least significant nibble. Then we can simply add it to the stored nibble to get the sum.InputAddressData……20008A…… Flow Diagram ProgramOutputAddressData……200112……
Here we will see how to perform BCD subtractions using 8085.Problem StatementWrite 8085 Assembly language program to perform BCD subtractions of tow numbers stored at location 8001 and 8002. The result will be stored at 8050 and 8051.DiscussionTo subtract two BCD numbers, we are going to use the 10s complement method. Taking the first number and storing into B, Load 99 into A then subtract the number to get the 9’s complement. After that add 1 with the result to get 10’s complement. We cannot increase using INR instruction. This does not effect on CY flag. So we have to ... Read More