Ir al contenido principal

Entradas

Crear función typeof en Java

Entradas recientes

Desactivar eventos tipo Spinner en input numérico

// Disable change of values ​​by pressing the cursor keys   $ ( 'input[type="number"]' ). bind ( 'keypress' ,   function ( event )   {        if   ( event )   {          if   ( event . keyCode   ==   38   ||   event . keyCode   ==   40 )   {   // arrow keys           return   false ;          }        }      });      // disable mousewheel on a input number field when in focus     // (to prevent Cromium browsers change the value when scrolling)     $ ( 'html' ). on ( 'focus' ,   'input[type=number]' ,   function ( e )   {        $ ( this ). on ( 'mousewheel.disableScroll' ,   function ( e )   {          e . preventDefault ();        });      });      $ ( 'html' ). on ( 'blur' ,   'input[type=number]' ,   function ( e )   {        $ ( this ). off ( 'mousewheel.disableScroll' );      });   

Custom Event Java

import java.util.* ; // An interface to be implemented by everyone interested in "Hello" events interface HelloListener { void someoneSaidHello (); } // Someone who says "Hello" class Initiater { private List < HelloListener > listeners = new ArrayList < HelloListener >(); public void addListener ( HelloListener toAdd ) { listeners . add ( toAdd ); } public void sayHello () { System . out . println ( "Hello!!" ); // Notify everybody that may be interested. for ( HelloListener hl : listeners ) hl . someoneSaidHello (); } } // Someone interested in "Hello" events class Responder implements HelloListener { @Override public void someoneSaidHello () { System . out . println ( "Hello there..." ); } } // test implementation class Test { public static void main ( String []

Java Fecha Actual

    public static String currentDate () {         Calendar calendar = new GregorianCalendar ();         Formatter dia = new Formatter (). format ( "%02d" , calendar . get ( Calendar . DATE ));         Formatter mes = new Formatter (). format ( "%02d" , calendar . get ( Calendar . MONTH ));         Formatter annio = new Formatter (). format ( "%04d" , calendar . get ( Calendar . YEAR ));         return dia + "/" + mes + "/" + annio ;     }

Flex Layout

<!DOCTYPE html> <html lang= "en" >     <head>         <meta charset= "UTF-8" >         <title> test flex box </title>     </head>     <style>         html, body {             height : 100 % ;             width : 100 % ;             padding : 0 ;             margin : 0 ;         }         body {             display : flex;             flex - direction : column;         }         header {             height : auto ;         }         main {             flex : auto ;             background-color : #ccc ;         }         footer {             height : 25px ;         }     </style> <body>     <header> header </header>     <main> main </main>     <footer> footer </footer> </body> </html>