Get Previous Node from a JTree in Java

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

219 Views

Use the getPreviousNode() method to get the previous node of this node in Java. Here, we are displaying the previous node of child node “eight” −System.out.println("Get Previous Node = "+eight.getPreviousNode());The following is an example to get the previous node from a JTree −Examplepackage my; import javax.swing.JFrame; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; public class SwingDemo {    public static void main(String[] args) throws Exception {       JFrame frame = new JFrame("Demo");       DefaultMutableTreeNode node = new DefaultMutableTreeNode("Products");       DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("Clothing (Product1 - P66778)");       DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("Accessories (Product2 - ... Read More

Reverse 16-Bit Number Using 8-Bit Operation in 8086

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

1K+ Views

In this program we will see how to reverse a 16-bit number using 8-bit operation.Problem StatementWrite 8086 Assembly language program to reverse a 16-bit number which is stored at location 2000 and 2001, using 8-bit operations.Discussion8086 has 8-bit operation for rotation. For 16-bit number, we are taking the bytes from 2000 and 2001. Then rotate each byte with ROL instruction. After that put the numbers in reverse form to reverse the bytes. Like the content of 2000 will be stored at 2001 after reverse, and content of 2001 will be stored at 2000 after reverse.InputAddressData……2000AB2001CD…… Flow Diagram ProgramOutputAddressData……2000DC2001BA……          

8259 PIC Microprocessor

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

28K+ Views

The 8259 is known as the Programmable Interrupt Controller (PIC) microprocessor. In 8085 and 8086 there are five hardware interrupts and two hardware interrupts respectively. Bu adding 8259, we can increase the interrupt handling capability. This chip combines the multi-interrupt input source to single interrupt output. This provides 8-interrupts from IR0 to IR7. Let us see some features of this microprocessor.This chip is designed for 8085 and 8086.It can be programmed either in edge triggered, or in level triggered modeWe can mask individual bits of Interrupt Request Register.By cascading 8259 chips, we can increase interrupts up to 64 interrupt linesClock ... Read More

Access Function Property as a Method in JavaScript

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

1K+ Views

Accessing a function as a method A javascript object is made up of properties. To access a property as a method, just define a function to a property and include other properties in that function.In the following example an object called "employee" is created with properties "fullName", "lastName" , "firstName" and "id". A function is defined under property "fullName" and properties such as "firstName" and "lastName" were included in it. So when the property "fullName" is called, the full name of the employee is going to display as shown in the output.Example-1Live Demo    var employee = {   ... Read More

Show Grants for Root in MySQL

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

139 Views

For this, use the following syntax, wherein we have used SHOW GRANTS −SHOW GRANTS FOR 'yourUserName'@'yourHostName';HostName may be ‘%’ or localhost.Let us implement the above syntax in order to show grants from ROOT −mysql> SHOW GRANTS FOR 'root'@'%' ;Output+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for root@%                                                                                                                   ... Read More

HTML DOM Input Datetime Disabled Property

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

167 Views

The HTML DOM Input Datetime disabled property sets/returns whether Input Datetime is enabled or disabled.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDatetimeObject.disabledSetting disabled to booleanValueinputDatetimeObject.disabled = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that the input datetime is disabled.falseIt defines that the input datetime is not disabled and it is also the default value.ExampleLet us see an example of Input Datetime disabled property − Live Demo Input Datetime Disabled Date & Time: Enable Datetime Input    var divDisplay = document.getElementById("divDisplay");    var inputDatetime = document.getElementById("datetimeSelect");    divDisplay.textContent = 'Datetime Input ... Read More

Play Audio and Video Files in iOS

Mohtashim M
Updated on 30-Jul-2019 22:30:26

1K+ Views

Understanding how to play audio and video in iOS is very important, as almost every application has audio and video these days. From your gaming application to social media to your music player and so on.In this post, we will be seeing how to play audio and video file using Swift.So let’s get started.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “AudioVideo”.Step 2 − Open Main.storyboard and add three buttons and name them as shown below.Step 3 − Create @IBOutlet for three buttons and name it to stop, playButton and video button, ... Read More

Combine MySQL UPDATE Statements

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

275 Views

You can use a CASE statement for this. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Name varchar(20)    ); Query OK, 0 rows affected (1.11 sec)Insert records in the table using insert command −mysql> insert into DemoTable(Name) values('John'); Query OK, 1 row affected (0.23 sec) mysql> insert into DemoTable(Name) values('Carol'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable(Name) values('David'); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select * from DemoTable;This will produce the following ... Read More

Get Max Statement Length Using DatabaseMetaData in Java

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

86 Views

The getMaxStatementLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in a single SQL statement.This method returns an integer value, representing the maximum number of characters allowed in an SQL statement. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() method ... Read More

MySQL SELECT When a Grouped Record Has Multiple Matching Strings

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

108 Views

You can use regular expression for this. Let us first create a table −mysql> create table DemoTable    (    ProductId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ProductName varchar(20)    ); Query OK, 0 rows affected (0.19 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(ProductName) values('Product-1'); Query OK, 1 row affected (0.05 sec) mysql> insert into DemoTable(ProductName) values('Product2'); Query OK, 1 row affected (0.06 sec) mysql> insert into DemoTable(ProductName) values('Product1'); Query OK, 1 row affected (0.04 sec) mysql> insert into DemoTable(ProductName) values('Product-3'); Query OK, 1 row affected (0.05 sec) mysql> ... Read More

Advertisements