How can I control the width of JTextFields in Java Swing?
问题 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? I want that they together take up 100% of the total width, so it would be good if I could use some kind of weigthing. I have tried with .setColumns() but it doesn't make sense. Here is an example, where I am using three rows with three strings that should appear as in columns: import java.awt.GridLayout; import javax.swing