What happens when JDialog is set with Modality type MODELESS in Java

Daniol Thomas
Updated on 30-Jul-2019 22:30:26

63 Views

Modeless dialog boxes are on the screen and are available for use. The following is an example to set JDialog with Modality type MODELESS:Exampleimport java.awt.Cursor; import java.awt.Dialog.ModalityType; import java.awt.Dimension; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; public class SwingDemo {    public static void main(String[] args) {       JFrame frame = new JFrame();       frame.setSize(new Dimension(600, 400));       JDialog dialog = new JDialog(frame, "New", ModalityType.MODELESS);       dialog.setSize(300, 300);       frame.add(new JButton(new AbstractAction("Click to generate") {          @Override          public void actionPerformed(ActionEvent ... Read More

C++ program to Implement Threaded Binary Tree

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

3K+ Views

Threaded binary tree is a binary tree that provides the facility to traverse the tree in a particular order.It makes inorder traversal faster and do it without stack and without recursion. There are two types of threaded binary trees.Single Threaded Each node is threaded towards either left or right means in-order predecessor or successor. Here, all right null pointers will point to inorder successor or all left null pointers will point to inorder predecessor.Double threaded Each node is threaded towards either left and right means in-order predecessor and successor. Here, all right null pointers will point to inorder successor and ... Read More

8086 program to determine modulus of first array elements corresponding to another array elements\

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

216 Views

In this program we will see how to perform modulus of the first array corresponding to the next array.Problem StatementWrite 8086 Assembly language program perform modulus of the first array corresponding to the next array.DiscussionIn this example there are two different arrays. The arrays are stored at location 501 onwards and 601 onwards. The size of these two arrays are stored at offset location 500. We are taking the array size to initialize the counter, then by using loops we are getting the modulus of the elements one by oneInputAddressData……500045010F5020B5030550408……601046020A6030260403……Flow DiagramProgram    MOV SI, 500     ;Point Source index ... Read More

Find in a dictionary like structure by value with MongoDB?

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

1K+ Views

You can use find() for this. Let us first create a collection with documents −> db.findInDictionaryDemo.insertOne( ...    { ...       "_id":101, ...       "AllCustomerDetails": ...       { ...          "SomeCustomerDetail1": ...          { ...             "CustomerName1":"John Doe", ...             "CustomerName2":"John Smith" ...          }, ...          "SomeCustomerDetail2": ...          { ...             "CustomerName1":"Carol Taylor", ...             "CustomerName2":"David Miller" ... Read More

C++ Program to Check Whether an Undirected Graph Contains a Eulerian Path

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

869 Views

The Euler path is a path; by which we can visit every node exactly once. We can use the same edges for multiple times. The Euler Circuit is a special type of Euler path. When the starting vertex of the Euler path is also connected with the ending vertex of that path.To detect the Euler Path, we have to follow these conditionsThe graph must be connected.Now when no vertices of an undirected graph have odd degree, then it is a Euler Circuit, which is also one Euler path.When exactly two vertices have odd degree, it is a Euler Path.InputOutputBoth of ... Read More

How to print document value in MongoDB shell?

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

1K+ Views

For this, work with the concept of forEach(). Let us first create a collection with documents −> db.printDocuementValueDemo.insertOne({"InstructorName":"John Smith"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd6804f7924bb85b3f48950") } > db.printDocuementValueDemo.insertOne({"InstructorName":"Sam Williams"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd680577924bb85b3f48951") } > db.printDocuementValueDemo.insertOne({"InstructorName":"David Miller"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd680637924bb85b3f48952") }Following is the query to display all documents from a collection with the help of find() method −> db.printDocuementValueDemo.find().pretty();This will produce the following output −{    "_id" : ObjectId("5cd6804f7924bb85b3f48950"),    "InstructorName" : "John Smith" } {    "_id" : ObjectId("5cd680577924bb85b3f48951"),    "InstructorName" : "Sam Williams" } ... Read More

HTML Tag

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

116 Views

The tag in HTML is the root of the HTML page or document and is considered as the container for all the other HTML elements.Let us now see an example to implement the tag −Example Live Demo Document Title comes here    Heading comes here    Content comes here OutputIn the above example, at first, we have set the doctype −After that the tag is used to set other elements inside it, including − Document Title comes here Now the tag is used to set the content − ... Read More

# and ## Operators in C ?

Arnab Chakraborty
Updated on 30-Jul-2019 22:30:26

2K+ Views

In this section we will see what are the Stringize operator(#) and Token Pasting operator(##) in C. The Stringize operator is a preprocessor operator. It sends commands to compiler to convert a token into string. We use this operator at the macro definition.Using stringize operator we can convert some text into string without using any quotes.Example Live Demo#include #define STR_PRINT(x) #x main() {    printf(STR_PRINT(This is a string without double quotes)); }OutputThis is a string without double quotesThe Token Pasting operator is a preprocessor operator. It sends commands to compiler to add or concatenate two tokens into one string. We use ... Read More

Print Postorder traversal from given Inorder and Preorder traversals

Sunidhi Bansal
Updated on 30-Jul-2019 22:30:26

874 Views

Given with inorder and preorder of a tree program must find the postroder traversal and print the sameInput: Inorder traversal in[] = {4, 2, 5, 1, 3, 6} Preorder traversal pre[] = {1, 2, 4, 5, 3, 6} Output: Postorder traversal post[] = {4, 5, 2, 6, 3, 1}AlgorithmSTART Step 1 -> declare function as find_value(int p, int in_order[], int n)    Loop For i=0 and i declare function as postorder(int pre_order[], int in_order[], int n)    Declare int variable as root = find_value(pre_order[0], in_order, n)    IF root!=0       Call postorder(pre_order+1, in_order, root)    End    IF ... Read More

MongoDB shutdown option is unavailable? How to get it?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

40 Views

You need to switch the database to admin. Following is the syntax −use adminThe syntax is as follows for shutdown option −db.shutdownServer()Let us implement the above syntax for shutdown −> use admin switched to db admin > db.shutdownServer()This will produce the following output −server should be down... 2019-04-22T19:11:40.949+0530 I NETWORK [js] trying reconnect to 127.0.0.1:27017 failed 2019-04-22T19:11:42.197+0530 I NETWORK [js] reconnect 127.0.0.1:27017 failed failed

Advertisements