how to see if you tap the screen in unity code example

Example 1: How do I see which version of Swift I'm using

// Open the Terminal and write:

swift -version

Example 2: How do I check if an element is hidden in jQuery?

// Checks CSS content for display:[none|block], ignores visibility:[true|false]

// The same works with hidden

Example 3: how to detect if someone clicks on a jpanel in java

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class TestFrame extends JFrame{

    public TestFrame(int size){
        JPanel content = new JPanel(new GridLayout(size, size));
        JPanel[] panel = new JPanel[size * size];
        PanelListener listener = new PanelListener();

        for(int i = 0; i < panel.length; i++){
            panel[i] = new JPanel();


    // MouseListener offers the method mouseClicked(MouseEvent e)
    private class PanelListener implements MouseListener {

        public void mouseClicked(MouseEvent event) {
                    /* source is the object that got clicked
                     * If the source is actually a JPanel, 
                     * then will the object be parsed to JPanel 
                     * since we need the setBackground() method
            Object source = event.getSource();
            if(source instanceof JPanel){
                JPanel panelPressed = (JPanel) source;

        public void mouseEntered(MouseEvent arg0) {}

        public void mouseExited(MouseEvent arg0) {}

        public void mousePressed(MouseEvent arg0) {}

        public void mouseReleased(MouseEvent arg0) {}


    public static void main(String[] args){
        TestFrame theGUI = new TestFrame(8);