I am trying to have several JTextFields on a single row, but I don\'t want them to have the same width. How can I control the width and make some of them wider than others?
// 1. create JTextField yourTextField = new JTextField(); // 2. store default height int defaultHeight = yourTextField.getSize().getHeight(); // 3. set custom width and default height yourTextField.setSize(new Dimension(yourWidth, defaultHeight));