First, set the layout method of the relevant container to setLayout (null). Then call the setBounds () method of the component to set the positions of the button to (100,100), with the length and width respectively 60 and 25jButton. setBounds (new Rectangle (100,100, 60, 25); [java import java. awt. container; import java. awt. dimension; import java. awt. rectangle; import java. awt. toolkit; import javax. swing. JButton; import javax. swing. JCheckBox; import javax. swing. JComboBox; import javax. swing. JFrame; import javax. swing. JPasswordField; import javax. swing. JTextField; public class Log extends JFrame {public static void main (String [] args) {Log log = new Log ();} private JButton btLog; private JTextField tfUser; private JPasswordField tfPwd; private JCheckBox pwdKeep; private JComboBox adminType; public Log () {super ("fixed asset management system"); super. setSize (380,292); super. setVisible (true); super. setdefaclocloseoperation (JFrame. EXIT_ON_CLOSE); centered (this); btLog = new JButton ("login"); btLog. setBounds (new Rectangle (93,220,180, 30); // The parameters are coordinates x, y, width, and height. setLayout (null); // set the layout manager to null this. add (btLog); tfUser = new JTextField (); tfUser. setBounds (new Rectangle (73,115,220, 25); this. add (tfUser); tfPwd = new JPasswordField (); tfPwd. setBounds (new Rectangle (73,150,220, 25); this. add (tfPwd); pwdKeep = new JCheckBox ("Remember password"); pwdKeep. setBounds (new Rectangle (68,185,110, 25); this. add (pwdKeep); adminType = new JComboBox (new String [] {"common employee", "Administrator", "Senior Administrator"}); adminType. setBounds (new Rectangle (183,185,100, 25); this. add (adminType);} // layout Center Method public void centered (Container container) {Toolkit toolkit = Toolkit. getdefatooltoolkit (); Dimension screenSize = toolkit. getScreenSize (); int w = container. getWidth (); int h = container. getHeight (); container. setBounds (screenSize. width-w)/2, (screenSize. height-h)/2, w, h );}}