Daniol Thomas has Published 197 Articles

How to handle mousedown and mouseup with HTML5 Canvas

Daniol Thomas

Daniol Thomas

Updated on 27-Jan-2020 10:52:11

820 Views

To handle the mousedown and mouseup event with HTML5 Canvas,var mouseDown = false; // for mousedown canvas1.onmousedown = function(event){    dragOffset.x = event.x - mainLayer.trans.x;    dragOffset.y = event.y - mainLayer.trans.y;    mouseDown = true; } // for mouseup canvas1.onmouseup = function(event){    if(mouseDown) mouseClick(eevent    mouseDown = false; }

IE supports the HTML5 File API

Daniol Thomas

Daniol Thomas

Updated on 27-Jan-2020 08:07:43

154 Views

IE9 does not support File APIIF10 started supported File APIAn example of that would be drag and drop. Now HTML 5 came up with a Drag and Drop (DnD) API that brings native DnD support to the browser making it much easier to code up.         ... Read More

What is the correct use of schema.org SiteNavigationElement in HTML?

Daniol Thomas

Daniol Thomas

Updated on 27-Jan-2020 07:27:04

752 Views

The schema.org SiteNavigationElement extends WebPageElement. It is used to mark-up links that would make amazing contextual links.                    Home page                              My demo page          

Managing user sessions in SAP UI5 application

Daniol Thomas

Daniol Thomas

Updated on 18-Dec-2019 08:42:39

992 Views

You can make use of setTimeout and clearTimeOut functions. In order to trace the activity of the user, you can either make use of mouse move event or key press event or even both.ExampleYou can reset the timer on the occurrence of either of the two events.document.onmousemove = timeOut; document.onkeypress ... Read More

Truncating multiple strings after 100 characters in ABAP

Daniol Thomas

Daniol Thomas

Updated on 18-Dec-2019 07:41:29

512 Views

You can just define a character of 100 bytes and move your variable to that character. Please find the below code as example.Example  

Calling external programs using SAP connector

Daniol Thomas

Daniol Thomas

Updated on 09-Dec-2019 06:46:49

283 Views

Yes, it is possible to address or call an external program using SAP connector SDK. From ABAP, you can reference external program by SAP’s RFC protocol.There are various SAP connector available for various programming languages. Few of them areJCo is the SAP Java connectorNCo is the .NET SAP connectorNW RFC ... Read More

What is the difference between == and === in JavaScript?

Daniol Thomas

Daniol Thomas

Updated on 18-Sep-2019 08:25:09

939 Views

Double equals (==) is abstract equality comparison operator, which transforms the operands to the same type before making the comparison. For example, 4    ==  4        // true '4'  ==  4        //true 4    == '4'       // true 0    == false ... Read More

Java Program to retrieve a Stream from a List

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:26

164 Views

Let us first create a List:List list = Arrays.asList(25, 50, 100, 200, 250, 300, 400, 500);Now, create a stream from the List:Stream stream = list.stream(); Arrays.toString(stream.toArray()));The following is an example to retrieve a Stream from a ListExampleimport java.util.Arrays; import java.util.List; import java.util.stream.Stream; public class Demo {    public static void ... Read More

Java Program to convert Stream to List

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:26

230 Views

Declare and initialize an Integer array:Integer[] arr = {50, 100, 150, 200, 300, 400, 500, 600, 700, 800, 1000};Now, create a stream with the above elements:Stream stream = Arrays.stream(arr);To convert the above stream to list, use Collectors.toList():stream.collect(Collectors.toList()The following is an example to convert Stream to List:Exampleimport java.util.Arrays; import java.util.stream.Collectors; import ... Read More

What happens when JDialog is set with Modality type MODELESS in Java

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:26

127 Views

Modeless dialog boxes are on the screen and are available for use. The following is an example to set JDialog with Modality type MODELESS:Exampleimport java.awt.Cursor; import java.awt.Dialog.ModalityType; import java.awt.Dimension; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; public class SwingDemo {    public static void main(String[] args) { ... Read More

Previous 1 ... 7 8 9 10 11 ... 20 Next
Advertisements