- 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
Smita Kapse has Published 558 Articles
Smita Kapse
134 Views
You can create a table in JavaDB database using the CREATE TABLE statement.SyntaxCREATE TABLE table_name ( column_name1 column_data_type1 constraint (optional), column_name2 column_data_type2 constraint (optional), column_name3 column_data_type3 constraint (optional) );To create a table in JavaDB using JDBC API you need to −Register the driver − The forName() method ... Read More
Smita Kapse
493 Views
To set JTextAream to wrap by word, you need to use the setWrapStyleWord(). Let’s say we have created a new JTextArea and set demo text −JTextArea textArea = new JTextArea("This is a text displayed for our example. More content is added in it now. More content is added in it ... Read More
Smita Kapse
342 Views
Yes, you can include a string value with spaces in ENUM type. Let us first create a table −mysql> create table DemoTable ( Size ENUM('SMALL SIZE', 'LARGE SIZE', 'XL SIZE') ); Query OK, 0 rows affected (0.65 sec)Let us check the description of table using DESC command ... Read More
Smita Kapse
949 Views
While designing any iOS Application you might come across a scenario where you have to do some sort of action if the screen is inactive for some amount of time.Here we will be seeing the same, we will be detecting user inactivity for 5 seconds.We will be using Apple’s UITapGestureRecognizer ... Read More
Smita Kapse
652 Views
To set the default background color of JTextPane, use the SimpleAttributeSet and StyleConstants class. At first, create a new JTextPane −JTextPane pane = new JTextPane();Now, use the classes to set the style and color −SimpleAttributeSet attributeSet = new SimpleAttributeSet(); StyleConstants.setBackground(attributeSet, Color.white);Now, apply the set to the pane −pane.setCharacterAttributes(attributeSet, true);The following ... Read More
Smita Kapse
71 Views
To reduce the time to find record in MongoDB, you can use index. Following is the syntax −db.yourCollectionName.createIndex({yourFieldName:1});You can follow the below approaches to create index for field names based on number, text, hash, etc.First ApproachLet us create an index. Following is the query −> db.takeLessTimeToSearchDemo.createIndex({"EmployeeName":1}); { "createdCollectionAutomatically" : ... Read More
Smita Kapse
266 Views
To get possible values for set field, you can use below syntax −desc yourTableName yourSetColumnName;Let us first create a table −mysql> create table DemoTable ( Game set('Chess', 'Pig Dice', '29 Card') ); Query OK, 0 rows affected (0.60 sec)Following is the query to get available values for ... Read More
Smita Kapse
2K+ Views
It is very important to know how to create a circular progress bar for iOS developers, almost every application have this.This is mainly used in showing the downloading status, loading status or any other progress related thing.Creating Circular Progress bar may become very tedious for new programmers and they might ... Read More
Smita Kapse
408 Views
To style code in a TextPane component use the setText() for text and work with HTML tags. For code, use the tag. Also, do not forget to set the content type to “text/html” −JTextPane pane = new JTextPane(); pane.setContentType("text/html");If you won’t set the content type, then the output will ... Read More
Smita Kapse
2K+ Views
To return documents of a collection without objectId, set _id:0. Let us first create a collection with documents −> db.returnDocumentWithoutObjectId.insertOne({"Name":"Carol", "Age":25}); { "acknowledged" : true, "insertedId" : ObjectId("5ce8ba6c78f00858fb12e8fa") } > db.returnDocumentWithoutObjectId.insertOne({"Name":"Sam", "Age":21}); { "acknowledged" : true, "insertedId" : ObjectId("5ce8ba6d78f00858fb12e8fb") } > db.returnDocumentWithoutObjectId.insertOne({"Name":"John", "Age":23}); { "acknowledged" ... Read More