Hi!

I would like to get an advise about the following question.

There is a set of text fields. The task is to generate a new JFrame and align text fields based on the information given, i.e. a row and column of each text field.

Let's say there is a text field called "Author", which has "row = 1" and "column = 2"; and also there is a text field called "Date", which has "row = 2" and "column = 1". So, now I must align text fields, e.g. "Author" must be placed in the first row and second column, etc.

I'm not sure about an approach that would be the most proper for solving this task. But it seems that some grid is required... Please, give me some advise. Thanks!

GridLayout or GridBagLayout

GridLayout is much simpler, but not nearly as functional as GridBagLayout. It just depends on your needs.

Thanks, I suppose it could help me. I'll come back in case of any questions regarding this topic.

Well, GridBagLayout perfectly fitted my needs. Thank you once again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.