java Common Components

A, Jpanel

  1, the panel: a container class components

  2, use: for use with Layout, JFrame-> JPanel-> Layout

Two, JTextField

  1, text boxes

  2, JPasswordField: password box

  3, constructors

  (1)JTextField()

  (2)JTextField(int columns)

  (3)JTextField(String text)

  4, commonly used method

  (1) SetText (string): the value of the text field Text
  (2) GetText (): Returns the text value of the text input field

  (3) setEditable (Boolean): whether the text field is read-only

Three, JLabel

  1, label

Four, JButton

  1, button

 

Guess you like

Origin www.cnblogs.com/liujianing/p/10926323.html