swing listeners
5000 단어 swing
addWindowListener(new WindowAdapter())
public abstract class WindowAdapter
implements WindowListener, WindowStateListener, WindowFocusListener
{
/**
* Invoked when a window has been opened.
*/
public void windowOpened(WindowEvent e) {}
/**
* Invoked when a window is in the process of being closed.
* The close operation can be overridden at this point.
*/
public void windowClosing(WindowEvent e) {}
/**
* Invoked when a window has been closed.
*/
public void windowClosed(WindowEvent e) {}
/**
* Invoked when a window is iconified.
*/
public void windowIconified(WindowEvent e) {}
/**
* Invoked when a window is de-iconified.
*/
public void windowDeiconified(WindowEvent e) {}
/**
* Invoked when a window is activated.
*/
public void windowActivated(WindowEvent e) {}
/**
* Invoked when a window is de-activated.
*/
public void windowDeactivated(WindowEvent e) {}
/**
* Invoked when a window state is changed.
* @since 1.4
*/
public void windowStateChanged(WindowEvent e) {}
/**
* Invoked when the Window is set to be the focused Window, which means
* that the Window, or one of its subcomponents, will receive keyboard
* events.
*
* @since 1.4
*/
public void windowGainedFocus(WindowEvent e) {}
/**
* Invoked when the Window is no longer the focused Window, which means
* that keyboard events will no longer be delivered to the Window or any of
* its subcomponents.
*
* @since 1.4
*/
public void windowLostFocus(WindowEvent e) {}
}
addItemListener(new ItemListener())
public interface ItemListener extends EventListener {
/**
* Invoked when an item has been selected or deselected by the user.
* The code written for this method performs the operations
* that need to occur when an item is selected (or deselected).
*/
void itemStateChanged(ItemEvent e);
}
addKeyListener(new KeyAdapter())
public abstract class KeyAdapter implements KeyListener {
/**
* Invoked when a key has been typed.
* This event occurs when a key press is followed by a key release.
*/
public void keyTyped(KeyEvent e) {}
/**
* Invoked when a key has been pressed.
*/
public void keyPressed(KeyEvent e) {}
/**
* Invoked when a key has been released.
*/
public void keyReleased(KeyEvent e) {}
}
addFocusListener(new FocusListener())
public interface FocusListener extends EventListener {
/**
* Invoked when a component gains the keyboard focus.
*/
public void focusGained(FocusEvent e);
/**
* Invoked when a component loses the keyboard focus.
*/
public void focusLost(FocusEvent e);
}
addActionListener(new ActionListener())
public interface ActionListener extends EventListener {
/**
* Invoked when an action occurs.
*/
public void actionPerformed(ActionEvent e);
}
addMouseDoubleClickListener(new MouseAdapter())
public abstract class MouseAdapter implements MouseListener, MouseWheelListener, MouseMotionListener {
/**
* {@inheritDoc}
*/
public void mouseClicked(MouseEvent e) {}
/**
* {@inheritDoc}
*/
public void mousePressed(MouseEvent e) {}
/**
* {@inheritDoc}
*/
public void mouseReleased(MouseEvent e) {}
/**
* {@inheritDoc}
*/
public void mouseEntered(MouseEvent e) {}
/**
* {@inheritDoc}
*/
public void mouseExited(MouseEvent e) {}
/**
* {@inheritDoc}
* @since 1.6
*/
public void mouseWheelMoved(MouseWheelEvent e){}
/**
* {@inheritDoc}
* @since 1.6
*/
public void mouseDragged(MouseEvent e){}
/**
* {@inheritDoc}
* @since 1.6
*/
public void mouseMoved(MouseEvent e){}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
[JAVA](Swing) 입력 받고 HTTP 요청 보내기 (GET, POST)문자열 입력받기 메이븐 추가 + jackson 추가 (IntelliJ) HTTP 요청 (HttpURLConnection) Java Swing을 이용해 문자열을 입력 받고 해당 문자열을 HTTP 요청 보내는 과정을 설...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.