Krantik Chavan has Published 308 Articles

Get all declared fields from a class in Java

Krantik Chavan

Krantik Chavan

Updated on 25-Jun-2020 12:22:18

3K+ Views

An array of field objects is returned by the method java.lang.Class.getDeclaredFields(). These field objects include the objects with the public, private, protected and default access but not the inherited fields.Also, the getDeclaredFields() method returns a zero length array if the class or interface has no declared fields or if a ... Read More

List methods of a class using Java Reflection

Krantik Chavan

Krantik Chavan

Updated on 25-Jun-2020 12:08:15

2K+ Views

The methods of a class can be listed using the java.lang.Class.getDeclaredMethods() method. This method returns an array that contains all the Method objects with public, private, protected and default access. However, the inherited methods are not included.Also, the getDeclaredMethods() method returns a zero length array if the class or interface ... Read More

What are the MessageChannel and MessagePort Objects in HTML5?

Krantik Chavan

Krantik Chavan

Updated on 25-Jun-2020 08:13:44

104 Views

While creating messageChannel, it internally creates two ports to send the data and forwarded it to another browsing context.postMessage() − Post the message throw channelstart() − It sends the dataclose() − it closes the portsIn this scenario, we are sending the data from one iframe to another iframe. Here we ... Read More

Rotate HTML5 Canvas around the current origin

Krantik Chavan

Krantik Chavan

Updated on 25-Jun-2020 07:37:37

320 Views

HTML5 canvas provides rotate(angle) method which is used to rotate the canvas around the current origin.This method only takes one parameter and that's the angle the canvas is rotated by. This is a clockwise rotation measured in radians.ExampleYou can try to run the following code to rotate HTML Canvas − ... Read More

HTML 5 Video Buffering a certain portion of a longer video

Krantik Chavan

Krantik Chavan

Updated on 25-Jun-2020 07:18:36

502 Views

Use the TimeRanges object in HTML to set a series of non-overlapping ranges of time. You can also set the start and stop time.The following are the properties −length − Length of time ranges.start(index) − start time, in secondsend(index) − end time, in secondsHere is the code snippet showing buffering −// ... Read More

How to detect the dragleave event in Firefox when draggingoutside the window with HTML?

Krantik Chavan

Krantik Chavan

Updated on 25-Jun-2020 05:44:27

103 Views

You need to track which elements dragenter and dragleave had been triggered on. Listening dragenter and dragleave on an individual element will capture not only events on that element but also events on children.$.fn.draghover = function(options) {    return this.each(function() {       var collection = $(),       self ... Read More

Set the style of the rule between columns with CSS

Krantik Chavan

Krantik Chavan

Updated on 24-Jun-2020 15:48:13

58 Views

To set the style of the rule between columns, use the column-rule-style property. You can try to run the following code to implement the column-rule-style property.ExampleLive Demo                    .demo {             column-count: 4;     ... Read More

Specify width for the columns with CSS

Krantik Chavan

Krantik Chavan

Updated on 24-Jun-2020 13:53:01

54 Views

Use the column-width property to specify the width of the columns. You can try to run the following code to implement the column-width property −ExampleLive Demo                    .demo {             column-count: 4;       ... Read More

Change the size of the pagination with CSS

Krantik Chavan

Krantik Chavan

Updated on 24-Jun-2020 11:28:45

248 Views

To change the pagination size, use the font-size property. You can try to run the following code to increase the size of pagination:ExampleLive Demo                    .demo {             display: inline-block;          } ... Read More

How to add the height of the element in HTML?

Krantik Chavan

Krantik Chavan

Updated on 24-Jun-2020 08:25:38

72 Views

Use the height attribute in HTML to set the height of an element. You can use the attribute with the following elements − , , , , , etc.ExampleYou can try to run the following code to implement height attribute in HTML −                                        Your browser does not support the video element.          

Advertisements