- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Arjun Thakur has Published 1109 Articles
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
448 Views
Let us first create a collection with documents −> db.findDataDemo.insertOne( { "_id": new ObjectId(), "CustomerName":"John", "CustomerDetails" : { "CountryName" : [ "AUS" ], ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
268 Views
To get the depth of root node in a JTree in Java, use the getDepth() method. Let’s say our root node is “node”, therefore, we will get the depth of root node like this −node.getDepth();The following is an example to get the depth of root node −Examplepackage my; import javax.swing.JFrame; ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
212 Views
The cite attribute of the element is used to set the source of a quotation. Following is the syntax −Above, url is the source of the quotation. Let us now see an example to implement the cite attribute of the element −Example Live Demo Magento Magento as stated ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
705 Views
NZEC is non-zero exit code.Exit codes are codes (number) return by running program to operating system upon either their successfully termination (Exit code 0) or failed termination due to error (Non zero exit code).As python or Java programming language supports exception handling, we can use exception handling using try-catch blocks ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
198 Views
The etched border gives an ‘etched’ look. Let’s say the following is our component −JLabel label; label = new JLabel("This has etched border with an 'etched' look!");Let us create an etched border with BorderFactory class −label.setBorder(BorderFactory.createEtchedBorder());The following is an example to create etched border for a component using BorderFactory class ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
83 Views
You can use $where operator along with some script.Let us first create a collection with documents −> dbsameValueMultipleTimesDemoinsertOne( { "ListOfPrice":[ {"Price": 110}, {"Price":130}, {"Price": 145} ] } ); { ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
315 Views
At first, set an Internal Frame in the JDesktopPane −JDesktopPane desktopPane = new JDesktopPane(); JInternalFrame intFrame = new JInternalFrame("Our Frame", true, true, true, true); desktopPane.add(intFrame);Now, set the bounds of the Internal Frame −intFrame.setBounds(50, 90, 200, 250);Create two components −JLabel label = new JLabel(intFrame.getTitle(), JLabel.CENTER); JButton button = new JButton("Demo Button");Add ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
131 Views
To delete specific record, use $pull operator. Let us first create a collection with documents −> dbdeletingSpecificRecordDemoinsertOne( { "StudentDetails": [ { "StudentName": "John", "StudentSubjectDetails": [ ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
1K+ Views
Let us first create a JTabbedPane −JTabbedPane tabbedPane = new JTabbedPane();Create some panels −JPanel panel1, panel2, panel3, panel4, panel5; panel1 = new JPanel(); panel2 = new JPanel(); panel3 = new JPanel(); panel4 = new JPanel(); panel5 = new JPanel();Now, add tabs using the addTab() method and set the panels as ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
4K+ Views
Use the setHgap() method to set the horizontal gap between elements in a GridLayout. Let’s say we have a GridLaypout −GridLayout layout = new GridLayout(2, 4);Set the horizontal gap −layout.setHgap(25);The following is an example −Examplepackage my; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JFrame; ... Read More