
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Chandu yadav has Published 1091 Articles

Chandu yadav
111 Views
The size attribute of the element is used to set the number of visible list items from a drop-down list. A scrollbar would get added if the size is set more than 1.Following is the syntax−Above, num is the count of the visible list items in the drop-down list.Let ... Read More

Chandu yadav
964 Views
To expand JTree row to display all the nodes and child nodes, use the expandRow() method in Java. At first, create a node −DefaultMutableTreeNode node = new DefaultMutableTreeNode("Project");Now, add nodes to the node created above −DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("App"); DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("Website"); DefaultMutableTreeNode node3 = new DefaultMutableTreeNode("WebApp"); ... Read More

Chandu yadav
197 Views
Set a MatteBorder from BorderFactory class −MatteBorder border = (MatteBorder)BorderFactory.createMatteBorder(2, -1, 5, 10, icon);Now, set the above created MatteBorder to a component −JButton button = new JButton("Matte Border"); button.setBorder(border);The following is an example to set a MatteBorder from BorderFactory class −Examplepackage my; import java.awt.BorderLayout; import java.awt.Container; import javax.swing.BorderFactory; import javax.swing.ImageIcon; ... Read More

Chandu yadav
1K+ Views
To set the grid color of a table, use the setGridColor() method.table.setGridColor(Color.yellow);Above, we have used the Color class to set the color.The following is an example to set the grid color of a table −Examplepackage my; import java.awt.Color; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.border.TitledBorder; ... Read More

Chandu yadav
562 Views
For this, use the LIKE operator. Let us first create a table:mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Password varchar(100) ); Query OK, 0 rows affected (1.27 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Password) values('John@--123'); ... Read More

Chandu yadav
263 Views
Yes, we can display a JTabPane with TextArea in one of the tabs. For that, let us first create a JTabbedPane component −JTabbedPane tabbedPane = new JTabbedPane();Now, create a text area you want to set under one of the tabs −JTextArea text = new JTextArea(100, 100);Now, set panels for the ... Read More

Chandu yadav
1K+ Views
In short, whenever control reach the return statement in your program, the execution of the program is terminated and the remaining statements will not executed.However, in case of yield, whenever control reach the yield statement in your program, the execution of your program is paused and later we can continue ... Read More

Chandu yadav
111 Views
The start attribute of the element is used to set the start value of the first list item.. Following is the syntax−Above, num is the number set for the start value of the first list item. Let us now see an example to implement the start attribute of the ... Read More

Chandu yadav
2K+ Views
To create a titled border for a component in Java, use the createTitledBorder() method. Let’s say we have a panel and we need to set a titled border to it. Here’s our panel −JPanel panel = new JPanel();Now, set the border and set the text for the tites border −panel.setBorder(BorderFactory.createTitledBorder( ... Read More

Chandu yadav
143 Views
You can use str_to_date() for this conversion. Let us first create a table −mysql> create table DemoTable ( stringDate varchar(100) ); Query OK, 0 rows affected (0.86 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('1h 15 min'); Query OK, 1 row ... Read More