¡Descarga Apuntes sobre operadores en Java: tipos, uso y ejemplos y más Apuntes en PDF de Tecnologías de la Información y la Comunicación solo en Docsity!
APUNTES GENERADOS EN 2018
DAVID GIMENEZ PLAZA
[email protected]
INDICE
- INDICE _______________________________________________________________
- USO DE OPERADORES JAVA ______________________________________________
- PARA QUE UTILIZAMOS LOS OPERADORES _____________________________________________
- Incrementales (++,--)___________________________________________________________
- Relacionales mayor que, menor que _____________________________________________
- Lógicos (y lógico, o lógico) ______________________________________________________
- Concatenación con cadena de caracteres ________________________________________
- Los que actúan a nivel de bits ___________________________________________________
- Y EN LA PRACTICA DIARIA CON JAVA __________________________________________________
- OPERADORES __________________________________________________________________
- USO __________________________________________________________________________
- SUMAR _______________________________________________________________________
- RESTAR _______________________________________________________________________
- / _____________________________________________________________________________
- DIVIDIR _______________________________________________________________________
- MULTIPLICAR __________________________________________________________________
- < ____________________________________________________________________________
- MENOR QUE ___________________________________________________________________
- MAYOR QUE ___________________________________________________________________
- =< ___________________________________________________________________________
- IGUAL O MENOR QUE ___________________________________________________________
- => ___________________________________________________________________________
- IGUAL O MAYOR QUE ___________________________________________________________
- != ____________________________________________________________________________
- DISTINTO QUE _________________________________________________________________
- == ___________________________________________________________________________
- IGUAL QUE ____________________________________________________________________
- && ___________________________________________________________________________
- Y LÓGICO _____________________________________________________________________
- || ____________________________________________________________________________
- O LÓGICO _____________________________________________________________________
- ++ ___________________________________________________________________________
- INCREMENTA 1 _________________________________________________________________
- -- ____________________________________________________________________________
- DECRECE 1 ____________________________________________________________________
- +=Nº _________________________________________________________________________
- INCREMENTA DE Nº EN Nº _______________________________________________________
- -=Nº __________________________________________________________________________
- DECRECE DE Nº EN Nº ___________________________________________________________
- X + Y + Z_______________________________________________________________________
- CONCATENAR __________________________________________________________________
- '^' ____________________________________________________________________________
- FINAL STRING __________________________________________________________________
- $ ____________________________________________________________________________
- INICIO STRING _________________________________________________________________
- instance of ____________________________________________________________________
- PARA SABER SI UNA CLASE ESTA INSTANCIANDO A OTRA ______________________________
- // ____________________________________________________________________________
- COMENTARIO __________________________________________________________________
- /* ____________________________________________________________________________
- INICIO COMENTARIO EN VARIAS LÍNEAS ____________________________________________
- */ ____________________________________________________________________________
- FIN COMENTARIO EN VARIAS LÍNEAS ______________________________________________
- % ____________________________________________________________________________
- NOS CALCULA EL RESTO DE UNA DIVISIÓN DE DOS NÚMEROS __________________________
- 10%2 = 0 ______________________________________________________________________
- 10%5 = 0 ______________________________________________________________________
- 10%3 = 1 (Ya que 10/3 = 3 y el resto es 1) ___________________________________________
- Ejemplo lo podemos utilizar para saber si un número es par if (9%2 ==0){} ______________
- << ___________________________________________________________________________
- & ____________________________________________________________________________
- | _____________________________________________________________________________
- TIPOS DE DATOS EN JAVA ___________________________________________
- LO BASICO____________________________________________________________
- } ___________________________________________________________________
- Bucles determinados ___________________________________________________
- For ______________________________________________________________________
- EJERCICIO PARA VALORAR CORREO ELECTRONICO ______________________________________
- MATRICES (ARRAYS O ARREGLOS) ________________________________________
- BUCLE FOR EACH ___________________________________________________________ - SINTAXIS ______________________________________________________________________
- ORDENAR UN ARRAY ______________________________________________________________
- ArrayList y LinkedList ______________________________________________________________
- MATRICES BIDIMENSIONALES_________________________________________________
- POO _________________________________________________________________
- Clase _________________________________________________________________
- Objeto _______________________________________________________________
- Ejemplar de clase _______________________________________________________
- Modularización ________________________________________________________
- Encapsulamiento/encapsulación: __________________________________________
- Métodos ______________________________________________________________
- o Método Gettes del inglés get (obtener) ___________________________________________
- o Método Setters del inglés set (establecer) _________________________________________
- Paso por parámetros ____________________________________________________
- Herencia ______________________________________________________________
- CLASS GregorianCalender _______________________________________________
- final _________________________________________________________________
- CREAR UNA SUB CLASE O CLASE HIJO ______________________________________
- POLIMORFISMO _______________________________________________________
- POLIMORFISMO ____________________________________________________________
- REFUNDICIÓN DE OBJETOS ______________________________________________
- USOS DEL final ________________________________________________________
- CLASES ABSTRACTAS ___________________________________________________
- MODIFICADORES ACCESO _______________________________________________
- Public ________________________________________________________________
- Protected _____________________________________________________________
- Private _______________________________________________________________
- No ponemos modificador ________________________________________________
- CLASS ENUM (enumerados)______________________________________________
- IMPLEMENTAR UNA INTERFACE __________________________________________
- SINTAXIS: _________________________________________________________________
- Interface comparable _______________________________________________________
- Instanceof ________________________________________________________________
- CREAR NUESTRA INTERFAZ (INTERFACE) ___________________________________
- ¿Paraqué lo hacemos?_______________________________________________________
- SINTAXIS interface: _________________________________________________________
- SINTAXIS interface heredada: _________________________________________________
- CLASES INTERNAS______________________________________________________
- ¿Qué son? ________________________________________________________________
- ¿Para qué sirve?____________________________________________________________
- Sintaxis ___________________________________________________________________
- CLASE INTERNA LOCAL __________________________________________________
- SINTAXIS__________________________________________________________________
- Simplificar clase interna _____________________________________________________
- INTERFACES DE USUARIOS (SWING) _______________________________________
- METODOS JFRAME _________________________________________________________
- setTitle (String title): _______________________________________________________________
- setVisible(boolean) : _______________________________________________________________
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) _____________________________________
- frame (ventana o marco). ___________________________________________________________ setBounds (x, y, width, height) : Lo utilizamos para dar tamaño y lugar en el espacio a nuestro
- setlocation(x,y) : __________________________________________________________________
- setResizable(boolean) ______________________________________________________________
- setExtendedState(Frame.MAXIMIZED_BOTH) ___________________________________________
- ¿Cómo trabajar dentro de un JFrame? __________________________________________
- Ejercicio. Incluir una lamina a nuestro frame (marco ______________________________ - Métodos ______________________________________________________________________ - draw3DRect ___________________________________________________________________ - drawOval ______________________________________________________________________ - drawLine ______________________________________________________________________ - fillRect ________________________________________________________________________ - setForceground(Color.Black): _____________________________________________________
- Saber los tipos de letras que tenemos en nuestro ordenador ______________________________
- DAR FORMATO A LOS TEXTOS ________________________________________________
- FUENTES ________________________________________________________________________
- COLOR FUENTE ___________________________________________________________________
- Establecer color fondo del marco: __________________________________________________
- Establecer color fondo letra ______________________________________________________
- INCLUIR Y MANIPULAR IMÁGENES DENTRO DE UN FRAME _________________________ - copyArea _________________________________________________________________ - HACER UN MOSAICO DENTRO DE UNA LAMINA ______________________________________
- EVENTOS _____________________________________________________________
- Crear un botón (button) ActionListener _________________________________________
- a implementar el método ___________________________________________________________ Es la interface que tenemos que utilizar para realizar acciones de botones, esta interface nos obliga
- Eventos de ventanas WindowListener __________________________________________
- Eventos de ventanas con clases adaptadoras ____________________________________
- CONTROLADOR DE ESTADOS DE UNA VENTANA __________________________________
- Eventos de teclado con interface KeyListner _____________________________________
- Eventos de ratón MouseListener ______________________________________________
- Eventos de ratón MouseMotionListener ________________________________________
- Eventos de foco en componentes FocusListener __________________________________
- Eventos de foco en marco windowFocusListener _________________________________
- UTILIZAR VARIAS FUENTES DE EVENTOS ________________________________________
- ASIGNAR ACCIONES AL TECLADO _________________________________________
- Múltiples fuentes para un solo oyente _________________________________________
- COMPONENTES SWING DISEÑO DE VENTANA ______________________________
- OBJETOS DE UN FRAME_____________________________________________________ - JButton ________________________________________________ - JLabel ____________________________________________ - JTextFiel ________________________________________ - JTextArea _________________________________________ - JTextPane ____________________________________________________________ - JScrollPane _______________________________ - JCheckBox __________________________ - JRadioButton ________________________________ - JComboBox _____________________________________ - JSlider ____________________________________________ - JSpinner ___________________________________________
- JTextArea ________________________________________________________________
- FlowLayout___________________________________________________________
- BorderLayout _________________________________________________________
- GridLayout ___________________________________________________________
- BoxLayout ___________________________________________________________
- Sintaxis general: __________________________________________________________
- Métodos de BoxLayout: ___________________________________________________________
- createHorizontalBox _______________________________________________________
- createVerticalBox _________________________________________________________
- createVerticarStrut ________________________________________________________
- createHorizontalStrut ______________________________________________________
- createGlue _______________________________________________________________
- CardLayout ___________________________________________________________
- GropuLayout _________________________________________________________
- Layout(null) __________________________________________________________
- SpringLayout _________________________________________________________
- costará estirar entre botones, contra menor sea la tensión más se separaran. ________ la separación dependiendo de los parámetros que le pasemos. A mayor tensión más le
- JCheckBox _____________________________________
- isSlected() ______________________________________________________________________
- setSlected(bolean) _______________________________________________________________
- paramString() ___________________________________________________________________
- JRadioButton _____________________________________________
- CREAR UN MÉTODO CONSTRUCTOR PARA CARGAR OBJETOS EN UNA LÁMINA ________
- JComboBox ____________________________________________________
- addItem() : Ingresa datos a la lista desplegable. ________________________________________
- getSelectedItem(): Obtener elemento seleccionado en este instante. ______________________
- JComboBox(new String[]{“1”,”2”…} pasar array ________________________
- JSlider _______________________________
- setPaintTicks(boolean) ____________________________________________________________
- setMajorTicksSpacing(int) _________________________________________________________
- setMinorTicksSpacing(int): _________________________________________________________
- setPaintLabels(boolean) Establece las etiquetas numéricas. ______________________________
- addChangeListener(ChangeListener): ________________________________________________
- setPreferredSize(new Dimension(ancho, alto) _________________________________________
- getValue () ______________________________________________________________________
- JSpinner ___________________________________________________
- JSpiner() ________________________________________________________________________
- JSpiner(SpinerModel model) _____________________________________________________
- SpinnerDateModer(fecha), ______________________________________________________
- JSpinner JS_pinner= new JSpinner( new SpinnerDateModel()); ______________
- SpinnerListModel(Texto) ________________________________________________________
- SpinnerNumberModel __________________________________________________________
- CLASES INTERNAS ANÓNIMAS___________________________________________
- CREAR UN MENÚ EN UN MARCO (JMenuBar, JMenu, JMenueltem) ____________
- } __________________________________________________________________ - ___________________________________
- JMenuBar, JMenu, JMenueltem) _________________________________________ CREAR UN MENÚ EN UN MARCO (JCheckBoxMenuItem, JRadioButtonMenuItem,
- INCLUIR UN JTEXTBOX EN EL MENÚ ______________________________________
- Construit menus emergentes (JPopMenu) _________________________________
- OCULTAR Y MOSTRAR MENUS DE UNA LAMINA ____________________________
- CREAR JMenuItem Y PONER A LA ESCUCHA TEXTO SELECCIONADO _____________
- NEGRITA _________________________________________________________________
- CURISVA _________________________________________________________________
- COLOR __________________________________________________________________
- CONTROLES DE TECLADO _______________________________________________
- BARRA DE HERRAMIENTAS JToolBar _____________________________________
- Uso JToolBar utilizando metodo Constructor _______________________________
- MENSAJES DE JAVA SWING _____________________________________________
- COMO CREAR CUADROS DE DIÁLOGO (VENTANS EMERGENTES) _______________
- Que son las ventanas emergentes ____________________________________________
- Tipos de ventanas emergentes _______________________________________________
- Cuadros de diálogo _______________________________________________________________
- Panel de elección de ficheros ______________________________________________________
- Panel de selección de colores ______________________________________________________
- CLASS StyledEditorKit para procesadores de texto __________________________
- BoldAction() ______________________________________________________________
- ItalicAction() _____________________________________________________________
- ForegroundAction(String, Color) ______________________________________________
- FontSizeAction(String, int tamaño) ____________________________________________
- UnderlineAction() _________________________________________________________
- AlignmentAction(string,int Luagar para alinear __________________________________
- CLASS ______________________________________________________________
- CLASS STRING ____________________________________________________________
- .Length(): __________________________________________________________________
- .charAt(nº posición): _________________________________________________________
- .substring(beginIndex,endIndex) ________________________________________________
- .equalis(anObject): ___________________________________________________________
- .equalisIgnoreCase (anObject)__________________________________________________
- .replace (charsequence target, charsequence replacement) __________________________
- o .charsequence replacement: ___________________________________________________
- .replacefirst (string regex, string replacement) ____________________________________
- .replaceAll (string regex, string replacement): _____________________________________
- String.valueOf(double)Transforma un número booleano en un String. ________________
- CLASS GregorianCalender ___________________________________________________
- CLASS Math ______________________________________________________________
REFUNDICIÓN DE OBJETOS
USOS DEL final
CLASES ABSTRACTAS
MODIFICADORES ACCESO
CLASS ENUM (enumerados)
IMPLEMENTAR UNA INTERFACE
CREAR NUESTRA INTERFAZ (INTERFACE)
CLASES INTERNAS
CLASE INTERNA LOCAL
INTERFACES DE USUARIOS (SWING)
EVENTOS
¿Qué es un evento?
Crear un botón (button) ActionListener
Eventos de ventanas WindowListener Eventos de ventanas con clases adaptadoras
CONTROLADOR DE ESTADOS DE UNA VENTANA
Eventos de teclado con interface KeyListner
Eventos de ratón MouseListener
Eventos de ratón MouseMotionListener Eventos de foco en componentes FocusListener
Eventos de foco en marco windowFocusListener
Escucha de Item para los JComboBox
UTILIZAR VARIAS FUENTES DE EVENTOS
Botón de marco
Ratón
Combinación teclado
Pero todas desencadenan la misma acción sobre un oyente.
ASIGNAR ACCIONES AL TECLADO
Múltiples fuentes para un solo oyente
COMPONENTES SWING DISEÑO DE VENTANA
CLASES INTERNAS ANÓNIMAS
CREAR UN MENÚ EN UN MARCO (JMenuBar, JMenu, JMenueltem)
CREAR UN MENÚ EN UN MARCO (JCheckBoxMenuItem,
JRadioButtonMenuItem, JMenuBar, JMenu, JMenueltem)
INCLUIR UN JTEXTBOX EN EL MENÚ
Construit menus emergentes (JPopMenu)
OCULTAR Y MOSTRAR MENUS DE UNA LAMINA
CREAR JMenuItem Y PONER A LA ESCUCHA TEXTO SELECCIONADO
CONTROLES DE TECLADO
BARRA DE HERRAMIENTAS JToolBar
Uso JToolBar utilizando metodo Constructor
MENSAJES DE JAVA SWING
COMO CREAR CUADROS DE DIÁLOGO (VENTANS EMERGENTES)
Que son las ventanas emergentes
Tipos de ventanas emergentes
Cuadros de diálogo
Panel de elección de ficheros
Panel de selección de colores
APLICAIONES JAVA FUERA DE ECLIPSE
COMO EJECUTAR UNA APLICICAIÓN FUERA DEL IDE
CLASS StyledEditorKit para procesadores de texto
CLASS