Descripción
Sintaxis
public abstract class Component extends Object implements ImageObserver, MenuContainer, Serializable
Constructores
Campos
Métodos
- action()
- add()
- addComponentListener()
- addFocusListener()
- addHierarchyBoundsListener()
- addHierarchyListener()
- addInputMethodListener()
- addKeyListener()
- addMouseListener()
- addMouseMotionListener()
- addMouseWheelListener()
- addNotify()
- addPropertyChangeListener()
- applyComponentOrientation()
- areFocusTraversalKeysSet()
- bounds()
- checkImage()
- coalesceEvents()
- contains()
- createImage()
- createVolatileImage()
- deliverEvent()
- disable()
- disableEvents()
- dispatchEvent()
- doLayout()
- enable()
- enableEvents()
- enableInputMethods()
- firePropertyChange()
- getAccessibleContext()
- getAlignmentX()
- getAlignmentY()
- getBackground()
- getBaseline()
- getBaselineResizeBehavior()
- getBounds()
- getColorModel()
- getComponentAt()
- getComponentListeners()
- getComponentOrientation()
- getCursor()
- getDropTarget()
- getFocusCycleRootAncestor()
- getFocusListeners()
- getFocusTraversalKeys()
- getFocusTraversalKeysEnabled()
- getFont()
- getFontMetrics()
- getForeground()
- getGraphics()
- getGraphicsConfiguration()
- getHeight()
- getHierarchyBoundsListeners()
- getHierarchyListeners()
- getIgnoreRepaint()
- getInputContext()
- getInputMethodListeners()
- getInputMethodRequests()
- getKeyListeners()
- getListeners()
- getLocale()
- getLocation()
- getLocationOnScreen()
- getMaximumSize()
- getMinimumSize()
- getMouseListeners()
- getMouseMotionListeners()
- getMousePosition()
- getMouseWheelListeners()
- getName()
- getParent()
- getPreferredSize()
- getPropertyChangeListeners()
- getSize()
- getToolkit()
- getTreeLock()
- getWidth()
- getX()
- getY()
- gotFocus()
- handleEvent()
- hasFocus()
- hide()
- imageUpdate()
- inside()
- invalidate()
- isBackgroundSet()
- isCursorSet()
- isDisplayable()
- isDoubleBuffered()
- isEnabled()
- isFocusable()
- isFocusCycleRoot()
- isFocusOwner()
- isFocusTraversable()
- isFontSet()
- isForegroundSet()
- isLightweight()
- isMaximumSizeSet()
- isMinimumSizeSet()
- isOpaque()
- isPreferredSizeSet()
- isShowing()
- isValid()
- isVisible()
- keyDown()
- keyUp()
- layout()
- list()
- locate()
- location()
- lostFocus()
- minimumSize()
- mouseDown()
- mouseDrag()
- mouseEnter()
- mouseExit()
- mouseMove()
- mouseUp()
- move()
- nextFocus()
- paint()
- paintAll()
- paramString()
- postEvent()
- preferredSize()
- prepareImage()
- print()
- printAll()
- processComponentEvent()
- processEvent()
- processFocusEvent()
- processHierarchyBoundsEvent()
- processHierarchyEvent()
- processInputMethodEvent()
- processKeyEvent()
- processMouseEvent()
- processMouseMotionEvent()
- processMouseWheelEvent()
- remove()
- removeComponentListener()
- removeFocusListener()
- removeHierarchyBoundsListener()
- removeHierarchyListener()
- removeInputMethodListener()
- removeKeyListener()
- removeMouseListener()
- removeMouseMotionListener()
- removeMouseWheelListener()
- removeNotify()
- removePropertyChangeListener()
- repaint()
- requestFocus()
- requestFocusInWindow()
- reshape()
- resize()
- revalidate()
- setBackground()
- setBounds()
- setComponentOrientation()
- setCursor()
- setDropTarget()
- setEnabled()
- setFocusable()
- setFocusTraversalKeys()
- setFocusTraversalKeysEnabled()
- setFont()
- setForeground()
- setIgnoreRepaint()
- setLocale()
- setLocation()
- setMaximumSize()
- setMinimumSize()
- setMixingCutoutShape()
- setName()
- setPreferredSize()
- setSize()
- setVisible()
- show()
- size()
- toString()
- transferFocus()
- transferFocusBackward()
- transferFocusUpCycle()
- update()
- validate()
Ejemplo
/** Formulario Básico con Swing **/
public class FormularioBasicoSwing extends JFrame {
private static final long serialVersionUID = 1L;
public FormularioBasicoSwing() {
super("Formulario Básico");
getContentPane().setLayout(new FlowLayout());
JLabel label = new JLabel("Introduce tu nombre:");
JTextField textfield = new JTextField("nombre",20);
JButton boton = new JButton("Enviar");
getContentPane().add(label);
getContentPane().add(textfield);
getContentPane().add(boton);
setSize(400,300);
setVisible(true);
}
public static void main(String argv[]) {
new FormularioBasicoSwing();
}
}
Artículos
Vídeos Java
Disfruta también de nuestros artículos sobre Java en formato vídeo. Aprovecha y suscribete a nuestro canal.