
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
Found 9150 Articles for Object Oriented Programming

1K+ Views
The map is basically a collection of elements where each element is stored as a Key, value pair. It can hold both objects and primitive values as either a key or a value. When we iterate over the map object it returns the key, value pair in the same order as inserted. The map has provided a method called map.clear() to remove the values inside a map. This method will remove every key/value pair and make the map totally empty.syntaxmap.clear(obj);map.obj() takes an object as a parameter and removes each and every value so as to make it empty.Example-1In the following example, a map is created ... Read More

333 Views
In this article, we will learn to implement the HTML text of a JButton in Java. The Swing JButton component has a useful feature in which developers can use HTML to style button labels. This feature enables us to make buttons appear more appealing by using simple HTML elements in our Java applications. What is a JButton? A JButton is a subclass of AbstractButton, and it is an important component in the Java Swing hierarchy. A JButton can be used mostly in login-based applications. Syntax The following is the syntax for JButton initialization: JButton button = new JButton("Button"); A JButton ... Read More
How to return an array whose elements are the enumerable property values of an object in JavaScript?

243 Views
We can use some logical methods to get the values and also keys from an object, but those methods will not return the values as an array, which is very useful in many cases. Javascript has provided Object.values() method to get an array whose elements are the enumerable property values of an object.syntaxObject.values(obj);This method takes an object as an argument and returns an array whose elements are nothing but the property values of the object.Example-1In the following example, an object is sent through the method object.values() and the property values were displayed as an array.Live Demo var obj = ... Read More

835 Views
In this article, we will learn to implement the word wrap JTableHeader of a JTable in Java. The Java Swing default JTableHeader does not support word wrapping. This is a problem if you have long column headers. We can implement this by customizing the DefaultTableModel class or the AbstractTableModel class. JTableHeader A JTableHeader is a subclass of the JComponent class. When we create a JTable object, the constructor creates a new JTableHeader object to manage the table component's header. Syntax The following is the syntax for JTableHeader Declaration: public class JTableHeader extends JComponent The JTableHeader object is associated with ... Read More

2K+ Views
In this article, we will learn to set the shortcut key to a JButton in Java. In Swing-based applications, we can implement the addition of keyboard shortcuts to buttons to enable quicker navigation by the user. What is a JButton? A JButton is a subclass of AbstractButton, and it can be used to add platform-independent buttons to a Java Swing application. When the button is pressed or clicked, a JButton can generate an ActionListener interface; it can also generate the MouseListener and KeyListener interfaces. Setting the Shortcut Key for JButton We can also set the shortcut keys for a JButton ... Read More

9K+ Views
In this article, we will learn to change each column width of a JTable in Java. JTable is Swing's strongest component for displaying and editing tabular information. Adjusting column widths appropriately to display content is among the most prevalent needs for customization. JTable A JTable is a subclass of JComponent for displaying complex data structures. A JTable can follow the Model View Controller (MVC) design pattern for displaying the data in rows and columns. The DefaultTableModel class can extend AbstractTableModel and it can be used to add the rows and columns to a JTable dynamically. Syntax The following is ... Read More

689 Views
Protocol The URL segment that specifies the data transfer protocol to be utilised is referred to as the protocol of a URL. In this example, https:// indicates for the HTTPS protocol. We will learn how to obtain the website URL for the currently seen webpage or website in this article. The 'URL' property of the Document object, which has data on the current URL, is used to get the current URL. The "URL" property returns a string that includes the complete address of the currently seen page as well as the HTTP protocol, such as (http://). Syntax Following is the ... Read More

473 Views
When a user accesses a web application using JavaScript, the "navigator" object contains details about the browser they are currently using. You may be aware that each browser functions differently when it comes to how it interprets JavaScript. In this case, the navigator object supports in modifying your application to the user's browser preferences. The browser engine or product name can be viewed in JavaScript by accessing the "navigator.product" attribute of a navigator object. In any browser, "Gecko" is always the value of the Navigator.product property. Only compatibility considerations are used to maintain this characteristic. Syntax The JavaScript syntax for ... Read More

2K+ Views
JTextArea is one of the most common Swing-based components. By default, it does not support text formatting such as bold, italics, or colored text inside a textarea. In this article, we will learn to display bold text inside the JTextArea in Java. What is a JTextArea? A JTextArea class can extend JTextComponent and allow a user to enter multiple lines of text inside it. A JTextArea can generate a CaretListener interface, which can listen to caret update events. Syntax The following is the syntax for JTextArea initialization: JTextArea textArea = new JTextArea(); Adding Bold Text Inside the JTextArea We ... Read More

2K+ Views
Javascript has provided a navigator object with which we can find any information regarding the browser. To get the application name and version information, navigator object has provided navigator.appName() and navigator.appVersion() respectively. Let's discuss each of them individually.Application Name of the browserTo get the application name, the navigator object has provided navigator.appName(). It may sound weird that "Netscape" is the application name for IE11, Chrome, Firefox, and Safari. So the output we get when we use navigator.appName() is Netscape.ExampleLive Demo document.write(navigator.appName); OutputNetscapeBrowser version informationTo get the browser version information, the navigator object has provided ... Read More